shatru Posted November 12, 2007 Report Share Posted November 12, 2007 I have pie chart Quote Link to comment Share on other sites More sharing options...
maximop Posted November 12, 2007 Report Share Posted November 12, 2007 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. Quote Link to comment Share on other sites More sharing options...
shatru Posted November 12, 2007 Author Report Share Posted November 12, 2007 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 Quote Link to comment Share on other sites More sharing options...
maximop Posted November 13, 2007 Report Share Posted November 13, 2007 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"; Quote Link to comment Share on other sites More sharing options...
shatru Posted November 14, 2007 Author Report Share Posted November 14, 2007 Please tell me how can I supply data to this axis ? currently I am supplying as double format( in seconds ). Quote Link to comment Share on other sites More sharing options...
maximop Posted November 14, 2007 Report Share Posted November 14, 2007 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. Quote Link to comment Share on other sites More sharing options...
shatru Posted November 14, 2007 Author Report Share Posted November 14, 2007 I think you misunderstood my problem. I don't mind sending data in double format. My only concern is to show the data in TOOL TIP of the chart in hh:mm:ss format, that's all. Quote Link to comment Share on other sites More sharing options...
maximop Posted November 16, 2007 Report Share Posted November 16, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.