So I have a Composite Chart made up of Line Chart layers with the X-Axis representing a bunch of dates, and the Y-Axes representing numeric values. Since the Series representing the data are NumericTimeSeries, the graph adds weekends to the X-Axis even though the data supplied are strictly weekdays.
I can switch to NumericSeries, but it doesn't draw anything unless I change the Axis.DataType to AxisDataType.String, and the Axis.SetLabelAxisType to SetLabelAxisType.ContinuousData which is fine except that my date formatting in the Axis.Labels.ItemFormatString gets ignored ("<ITEM_LABEL:MM/dd/yyyy>").
I'd prefer to keep the NumericTimeSeries and somehow communicate that I wish for missing time intervals to be ignored, but I doubt that's possible from what I've seen in the scant documentation. If I'm forced to treat the dates as strings, how can I force them to be formatted the way I need?
Thanks,ChrisPowers
By the way, I'm using 2007 Volume 1 CLR 2.x Release (v7.1.20071.40).
try setting the X axis's TimeAxisStyle property to Discrete.
you could also use IRenderLabel to force formatting on the string labels:
string IRenderLabel.ToString(Hashtable context)
{
return DateTime.Parse(context["ITEM_LABEL"].ToString()).ToString("MM/dd/yyyy");
}
Do you know if setting the TimeAxisStyle to Discrete will work, or you just taking a guess at it?
I ask because I tried this before and it had no effect, but I may have been overlooking some other setting elsewhere. However, when the forum archive went back up last week, I managed to find a reference to that IRenderLabel method for intercepting the label formatting, and it seems to be working okay. So, I'm reluctant to spend the time reverting my code to try out the Discrete TimeAxisStyle only to have it not work, but I would prefer to do it the right way if possible. Right now, what I'm doing feels like a hack.