Logo
UI Elements

Vertical Chart

Compare categories with vertical bars

Overview

Vertical Chart compares numeric values across labeled categories. It uses the shared ChartBase styling and update workflow, with procedural bars and automatic range calculation.

Preview

Usage

Create the chart and add labeled data points.

Leave Auto Scale enabled to derive the range from the data, or set Maximum Value manually.

Choose whether to show values, category labels, scale labels, grid, and axes.

Use the data methods for runtime changes.


Tips

  • Scale Divisions controls the value grid.
  • Label Rotation can be Auto, Horizontal, or Angled.
  • Bar Shape controls procedural bar appearance; Use Data Colors lets individual points supply their colors.

Public API

Use VerticalChart in the Evo.UI namespace.

Properties

Setting a property refreshes the chart. After editing dataPoints or a shape settings field directly, call DrawChart().

NameTypeDescription
ScaleDivisionsintNumber of intervals on the numeric axis, from 1 to 50.
AutoScaleboolScales bars to the largest value. Disable to use Maximum Value.
MaximumValuefloatValue of the outermost grid line while Auto Scale is disabled.
UseDataColorsboolUses each data point's color instead of the shared bar color.
PlotPaddingfloatInset between the bars and the plot edges in local UI units.
BarSpacingfloatGap between adjacent bars in local UI units. Reduced when needed to fit the data.
BarCornerRadiusfloatUniform bar corner radius, in pixels or percent according to Bar Shape radius mode.
ShowGridboolShows grid lines.
GridLineThicknessfloatGrid line width in local UI units, from 0.1 to 20.
ShowAxisboolShows the axis lines.
AxisThicknessfloatAxis line width in local UI units, from 0.1 to 20.
ShowCategoryLabelsboolShows category names.
LabelFontSizefloatCategory label font size. Labels may shrink to fit short rows.
LabelPaddingfloatGap between category labels and the plot in local UI units.
LabelRotationModeLabelRotationHow bottom-axis labels turn when crowded.
ShowScaleLabelsboolShows numeric labels along the value axis.
ScaleFontSizefloatNumeric axis font size. Scale labels may shrink to fit the plot.
ScalePaddingfloatGap between numeric scale labels and the plot in local UI units.
ShowValuesboolShows numeric values beside bars or points.
ValueFontSizefloatData value font size. Values may shrink to fit the plot.
ValuePaddingfloatGap between data values and their bars in local UI units.
DisplayFormatNumberDisplayFormatNumeric format used by value and scale labels.

Fields

NameTypeDescription
dataPointsList<DataPoint>Labeled values to draw.
barShapeShapeSettingsBar corner, softness and outline settings.

Methods

NameParametersDescription
UpdateData()List<DataPoint> newDataReplaces all data.
AddDataPoint()string label, float valueAdds a labeled value.
SetDataPoint()int index, string label, float valueUpdates a data point by index.
SetDataPoint()DataPoint item, string label, float valueUpdates a data point by reference.
RemoveDataPoint()int indexRemoves a point by index.
ClearData()NoneRemoves all data points.
DrawChart()NoneRefreshes the chart from current data and settings.

Example

VerticalChartExample.cs
using UnityEngine;
using Evo.UI;

public class VerticalChartExample : MonoBehaviour
{
    [SerializeField] private VerticalChart target;

    private void Start()
    {
        target.ClearData();
        target.AutoScale = true;
        target.BarSpacing = 12f;
        target.AddDataPoint("January", 45f);
        target.AddDataPoint("February", 70f);

        // Call this when modifying the data entries directly
        target.DrawChart();
    }
}

On this page