简体   繁体   中英

Is it possible to display the x-axis values of the DataVisualization.Charting.Chart in hexadecimal?

Recently started using the Chart control included in .NET 4 in the DataVisualization.Charting namespace. I am working on a project where a delay value used in an FPGA is displayed on the x-axis of a line chart during calibrations. The value is used elsewhere as a hexadecimal value.

Was wondering if there is a way to display the x-axis labels in hexadecimal format. It's not vital as can simply convert values following runs with relative ease, but would certainly be an enhancement. Any help greatly appreciated.

The LabelStyle of the Axis objects have a Format property, so you can use any of the standard C# formatting strings. You can thus set

chart1.ChartAreas[0].AxisX.LabelStyle.Format = "X4";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM