Jump to content
Software FX Community

pie chart of chart FX tool tip formatting


Recommended Posts

You can format the tooltip in the following manner:

string myFormat = "I am slice %N and I represent %p%% of this pie.";

chart1.ToolTipFormat = myFormat;

The %N and %p are variable settings that contain information about a series or point on the chart. You can refer to the ToolTipFormat property of the chart in the ChartFX documentation.

Link to comment
Share on other sites

thanks maximop for reply,

but actually I wanted format my data content which is shown by the tooltip..

for example..

Currently I am using following,

m_opRateTimeChart.SetTipMask("Operation Time Chart%l%vSec out of %tSec(%p%%)");

& it gives me output like this "Operation Time Chart 2030 Sec out of 4030 Sec"

But I needed the output like "Operation Time Chart 01:20:33 out of 12:12:00"  i.e in format "hh:mm:nn"





Link to comment
Share on other sites

The AxisX and AxisY Objects expose a DataFormat and LabelsFormat property; you can set them in the following way:

chart1.AxisX.DataFormat.Format = AxisFormat.DateTime;

chart1.AxisX.DataFormat.CustomFormat =

"HH:mm:ss";chart1.AxisX.LabelsFormat.Format = AxisFormat.DateTime;

chart1.AxisX.LabelsFormat.CustomFormat =

Link to comment
Share on other sites

The charts will only plot numerical data. If you are trying to plot DateTime values as the value contained within a Pie Slice, this is not possible. If you pass a DateTime value to the chart, this will be interpreted by its double value representation and that is what's going to be plotted. Additionally, Pie Charts do not use an axis to plot its data.

Link to comment
Share on other sites

Sorry for the confusion. What you need to do in order to show the Tooltip with the actual DateTime value, is to set the Text property for each data point (Pie slice) with the conversion of the DateTime value, and then set the ToolTipFormat property of the chart with the %L variable setting which exposes the value of the Points.Text property. You can do the following:

chart1.Points[0, 0].Text = DateTime.FromOADate(chart1.Data[0, 0]).ToShortDateString();

chart1.Points[0, 1].Text =

DateTime.FromOADate(chart1.Data[0, 1]).ToShortDateString();chart1.Points[0, 2].Text = DateTime.FromOADate(chart1.Data[0, 2]).ToShortDateString();

chart1.ToolTipFormat =


Hope this helps.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...