Jump to content
Software FX Community

pie chart of chart FX tool tip formatting


shatru
 Share

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"

Regrads,

Shatrughan 

 

 

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 =

"HH:mm:ss";
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 =

"%L";

Hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...