Spread ASP.NET 14
FarPoint.Web.Chart Assembly / FarPoint.Web.Chart Namespace / BinOption Class / BinSize Property
Example


In This Topic
    BinSize Property
    In This Topic
    Gets or sets the size of the bin data for the histogram series.
    Syntax
    'Declaration
     
    Public Property BinSize As Double
    'Usage
     
    Dim instance As BinOption
    Dim value As Double
     
    instance.BinSize = value
     
    value = instance.BinSize
    public double BinSize {get; set;}
    Example
    This example sets the bin size.
    FarPoint.Web.Chart.HistogramSeries hs = new FarPoint.Web.Chart.HistogramSeries();
    hs.SeriesName = "Histogram Sample";
    hs.Values.Add(23);
    hs.Values.Add(5);
    hs.Values.Add(79);
    hs.Values.Add(11);
    hs.Values.Add(23);
    hs.Values.Add(55);
    hs.Values.Add(88);
    hs.Values.Add(67);
    hs.Values.Add(42);
    hs.Values.Add(56);
    hs.BinOption.BinSize = 20;
    
    FarPoint.Web.Chart.YPlotArea plotArea = new FarPoint.Web.Chart.YPlotArea();         
    plotArea.Series.Add(hs);
    FarPoint.Web.Chart.ChartModel model = new FarPoint.Web.Chart.ChartModel();
    model.PlotAreas.Add(plotArea);
    FarPoint.Web.Spread.Chart.SpreadChart chart = new FarPoint.Web.Spread.Chart.SpreadChart();
    chart.Model = model;           
    FpSpread1.ActiveSheetView.Charts.Add(chart);
    Dim hs As New FarPoint.Web.Chart.HistogramSeries()
    hs.SeriesName = "Histogram Sample"
    hs.Values.Add(23)
    hs.Values.Add(5)
    hs.Values.Add(79)
    hs.Values.Add(11)
    hs.Values.Add(23)
    hs.Values.Add(55)
    hs.Values.Add(88)
    hs.Values.Add(67)
    hs.Values.Add(42)
    hs.Values.Add(56)
    hs.BinOption.BinSize = 20
    
    Dim plotArea As New FarPoint.Web.Chart.YPlotArea()
    plotArea.Series.Add(hs)
    Dim model As New FarPoint.Web.Chart.ChartModel()
    model.PlotAreas.Add(plotArea)
    Dim chart As New FarPoint.Web.Spread.Chart.SpreadChart()
    chart.Model = model
    FpSpread1.ActiveSheetView.Charts.Add(chart)
    See Also