I have a chart which is going to show an area chart with one point for each day over a 6 month period. I only want to show an X axis item for each month of the 6 month period. I tried just adding an Item for each new month (ex. RadChart1.PlotArea.XAxis.AddItem("Name of Month")) but then the other set of data doesn't show up (eg. the chart is empty).
If I add one item for every item in my series (one for every day) I end up with a completely unreadable mess at the bottom of the chart. Instead, I tried added a new item, but setting it's text to empty, ex. RadChart1.PlotArea.XAxis.AddItem(""). That is also unreadable - it fills in the empty values with 0.
Here's what the code basically looks like:
Any thoughts on how I can do this?
Also, is there a way to shut off the value that appears at the top of each data point in the chart (above each "bar")?
If I add one item for every item in my series (one for every day) I end up with a completely unreadable mess at the bottom of the chart. Instead, I tried added a new item, but setting it's text to empty, ex. RadChart1.PlotArea.XAxis.AddItem(""). That is also unreadable - it fills in the empty values with 0.
Here's what the code basically looks like:
| this.radRollingChart.AutoLayout = true; |
| this.radRollingChart.AutoTextWrap = true; |
| Telerik.Charting.ChartSeries peopleSeries = new Telerik.Charting.ChartSeries("People", Telerik.Charting.ChartSeriesType.Area); |
| this.radRollingChart.Series.Add(peopleSeries); |
| peopleSeries.PlotArea.XAxis.AutoScale = false; |
| int currentMonth = 0; |
| foreach (DataRow row in traffic.Rows) |
| { |
| DateTime ddate = (DateTime)row["ddate"]; |
| if (ddate.Month != currentMonth) |
| { |
| string date = ddate.ToString("MMM dd yyyy"); |
| this.radRollingChart.PlotArea.XAxis.AddItem(date); |
| currentMonth = ddate.Month; |
| } |
| else |
| this.radRollingChart.PlotArea.XAxis.AddItem(""); |
| peopleSeries.AddItem((int)row["Count"]); |
| } |
Any thoughts on how I can do this?
Also, is there a way to shut off the value that appears at the top of each data point in the chart (above each "bar")?