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
1330
Only show every nth value on X axis
posted

In Excel i can set major units on graphs, is there somehting similar here?

E.g The following graph is showing 31 years (2008 - 2038)

The following is showing 40 years and you will notice the years are missing

 

Is there a way to show every 3rd year in the x axis?

Parents
No Data
Reply
  • 30692
    Suggested Answer
    Offline posted

    Does something like this work for you?

                ultraChart1.ChartType = ChartType.ColumnChart;

                ultraChart1.LineChart.TreatDateTimeAsString = false;

                ultraChart1.Data.SwapRowsAndColumns = true;

                

                ultraChart1.Axis.X.Labels.ItemFormat = AxisItemLabelFormat.Custom;

                ultraChart1.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL:yyyy>";

                ultraChart1.Axis.X.Labels.Orientation = TextOrientation.VerticalLeftFacing;

     

                ultraChart1.Axis.X.TickmarkStyle = AxisTickStyle.DataInterval;

                ultraChart1.Axis.X.TickmarkIntervalType = AxisIntervalType.Years;

                ultraChart1.Axis.X.TickmarkInterval = 3;

     

                ultraChart1.DataSource = GetSampleColumnData();

                ultraChart1.DataBind();

    -Graham

Children