dfigueire Posted November 28, 2007 Report Share Posted November 28, 2007 I recently download the Chart FX free .NET. So far everything has been simple to do. But I cannot seem to get the date or time into the x axis. I just want the hour and minutes. How is this done? Second question, is it better to set this in the properties or programmatically? Link to comment Share on other sites More sharing options...
maximop Posted November 28, 2007 Report Share Posted November 28, 2007 You need to set the LabelsFormat and DataFormat properties, respectively. The LabelsFormat property of the x-axis is exposed in both design-time and code-behind but the DataFormat property is only exposed in the code. You can programmatically set this as follows: chart1.AxisX.DataFormat.Format = AxisFormat.Time; chart1.AxisX.DataFormat.CustomFormat = "HH:mm";chart1.AxisX.LabelsFormat.Format = AxisFormat.Time; chart1.AxisX.LabelsFormat.CustomFormat = "HH:mm"; Link to comment Share on other sites More sharing options...
dfigueire Posted November 28, 2007 Author Report Share Posted November 28, 2007 Well I think I have my answer. AxisFormat.Time does not exist. I guess that's because I am using the Free .NET version. Thanks Link to comment Share on other sites More sharing options...
dfigueire Posted November 28, 2007 Author Report Share Posted November 28, 2007 Is there another way for me to set time into the x axis. Without it I don't see how I can pull off my demo. Thanks for you help. Link to comment Share on other sites More sharing options...
maximop Posted November 28, 2007 Report Share Posted November 28, 2007 Which free version are you using? ChartFX Lite for .NET? If so, please note that this version of ChartFX is very limited and as you already know, does not have all of the features that the full version has. I recommend you download a trial for ChartFX for Visual Studio 2005 if you're actually intending to use this product. In your version of ChartFX, the Axis Class exposes the LabelsFormat Property, and the ValueFormat Class exposes both the Format and the CustomFormat properties, respectively. Unfortunately, in this version of ChartFX, the Format Enumerator only has values for None, Number, and Currency. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.