I am using a bar chart for the first time with multiple bars per 'series'. My data source is a datatable with 4 columns; datetime, integer, integer, integer.
1. How can I format the X axis series labels for the date 'MM/dd'. Only show the month and day. I have tried several things including ".Axis.X.Labels.ItemFormatString = "<ITEM_LABEL:MM/dd>"" without success.
2. How can keep my Y axis labels whole numbers only. My data values are low numbers generally between 2 and 10 so the X axis wants to show fractions. I only want to show whole numbers; 1,2,3,4,5,6,7,8,9,10.
3. How can I customize the bar labels on the X axix? My integer column names are 'qty1', 'qty2' and 'qty3'. How can I set the column labels on the chart through code? Instead of 'qty1', show 'Sales Over'.
try this:
Axis.X.TickmarkStyle = DataInterval
Axis.X.TickmarkInterval = 1.0
For #2, I tried what you suggested which did change the format of the numbers to whole numbers only, but now it shows the same whole number for all the minor axis lines. How can I remove the minor axis lines? I've tried the following line of code yet the minor axis lines continue to be drawn.
.Axis.Y.MinorGridLines.Visible = False
1: since the bar chart interprets the x axis labels as strings and not dates, this formatting is not possible. you can implement IRenderLabel to achieve the desired result.
2: Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:#>";
3: see the documentation topics on IRenderLabel, they should explain how to solve this problem.