Skip to main content

HorizontalBarDataSet

Namespace: Wisej.Web.Ext.ChartJS3

Assembly: Wisej.Web.Ext.ChartJS3 (4.1.0.0)

Specialized data set for the HorizontalBar chart.

public class HorizontalBarDataSet : BarDataSet

Chart.js 3 draws horizontal bars as a "bar" chart with the index axis set to "y". The DataSetCollection creates BarDataSet instances for a HorizontalBar chart; set IndexAxis to "y" to lay the bars horizontally.

Example:

this.chartJS31.ChartType = ChartType.HorizontalBar;
this.chartJS31.Options.IndexAxis = "y";
this.chartJS31.Labels = new[] { "Chrome", "Firefox", "Safari" };

var share = (BarDataSet)this.chartJS31.DataSets.Add("Share");
share.Data = new object[] { 64, 18, 12 };

Constructors​

Instance member HorizontalBarDataSet()​

Constructs a new instance of HorizontalBarDataSet.

The new data set has Type set to HorizontalBar.

Example:

var dataSet = new HorizontalBarDataSet
{
Label = "Hours",
Data = new object[] { 7.5, 6, 8 }
};
this.chartJS31.DataSets.Add(dataSet);