Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1005
Histogram problems
posted

Hi,

I am trying to get the histogram chart working, but when I type in the code for the example shown in the help it doesn't come out quite right.  All the bars are at the left of the chart instead of being spread over the whole width! :(

I have attached a picture of my chart, any ideas what's causing this?

I'm using version 8.3

Thanks.

Brian

  • 26458
    Offline posted in reply to Brian

    This seems to be a bug in the histogram. Could you please log it with our developer support group (http://es.infragistics.com/gethelp)

    As a temporary workaround, you can use a column chart instead of the histogram, but you'll have to calculate the frequencies first, store them in a table and then use that new table as the datasource for the column chart.

  • 1005
    posted

    Since I haven't had a reply yet, I thought I'd just add the code that I used, which as I said is exactly what the example in the help tells you to do.  It appears that the smaller I make the TickmarkInterval, the closer the chart gets to what it should be, but obviously it has more bars too!

    chart.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.HistogramChart;

    chart.Axis.X.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.DataInterval;

    chart.Axis.X.TickmarkInterval = 5;

    chart.Axis.X.RangeMin = 0;

    chart.Axis.X.RangeMax = 20;

    chart.Axis.X.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom;

    chart.Axis.X.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal;

    chart.HistogramChart.ColumnAppearance.StringAxis = false;

    chart.HistogramChart.ColumnAppearance.ShowInLegend = true;

    chart.Legend.Visible = true;

    chart.Legend.BackgroundColor = Color.Transparent;

    chart.Legend.BorderColor = Color.Black;

    chart.Data.DataSource =

    new int[ { 1, 2, 4, 5, 6, 7, 8, 9, 9, 9, 12, 13, 14, 15, 16 };

    chart.Data.DataBind();