|
issues with Pie chart |
Posted by Dilip Agarwal on Aug-08-2013 18:38 |
|
Hi Peter, In Pie chart I do not want to show sector name and there values attached with the sectors. Instead this I want to show Tooltip (sectorname:value) on sectors at mouse hover.
But I found by default sector names and there values are attached with sector. When I do not give sector names at the creation of pie chart then it does not show sector name but values still shows. Please tell me how can I hide these.
Second issues is with tooltips. in tooltips floting point values are converted to decimal values like if values is 0.463506493506493 then it is shows as 463506493506493 in tooltip.
Below is the code which I use for this. Please tell me how can I do change for above issues.
Set c = cd.PieChart(960, 370)
Call c.setPieSize(480, 180, 150)
Call c.addTitle(graphTitle, "arialbd.ttf", 12)
Dim i
Dim legendStrForCustomAttr
legendStrForCustomAttr = ""
Call c.setData(baseDataArray,legendArray)
Call c.setColors2(cd.DataColor, colors)
for i=0 to UBound(legendArray)
if i <> UBound(legendArray) then
legendStrForCustomAttr =legendStrForCustomAttr& legendArray(i) &"::"&baseColorArrHTML(i)&"::T"&",,"
legendsState = legendsState & "T,"
else
legendStrForCustomAttr = legendStrForCustomAttr&legendArray(i) &"::"&baseColorArrHTML(i)&"::T"
legendsState = legendsState & "T"
end if
next
Call viewer.setCustomAttr("legendStr",legendStrForCustomAttr)
Call viewer.setCustomAttr("graphTitle",graphTitle)
Call viewer.setCustomAttr("legendsState",legendsState)
chartQuery = c.makeSession(Session, viewer.Id)
viewer.ImageUrl = "getchart.asp?" & chartQuery
viewer.imageMap = c.getHTMLImageMap("", "", _
"title='{dataSetName}: {value|0}'")
viewer.ChartMetrics = c.getChartMetrics()
|
Re: issues with Pie chart |
Posted by Peter Kwan on Aug-08-2013 22:26 |
|
Hi Dilip,
There are quite a number of examples in ChartDirector that shows pie charts without any sector labels. May be you can use them as references. An example is the "2D Pie Shading" sample code. The following code is copied from the "2D Pie Shading" sample code:
' Disable the sector labels by setting the color to Transparent
Call c.setLabelStyle("", 8, cd.Transparent)
Hope this can help.
Regards
Peter Kwan |
Re: issues with Pie chart |
Posted by Dilip Agarwal on Aug-09-2013 00:43 |
|
Thanks Peter, but what's about the tooltip issues, that converts floting point value to
decimal |
Re: issues with Pie chart |
Posted by Peter Kwan on Aug-09-2013 22:07 |
|
Hi Dilip,
According to your code, it the data value is 0.463506493506493, then in the tooltip it should display as 0, not as 463506493506493. The value is displayed as 0 because your configure the tooltip to display with zero decimal place with "{value|0}". Are you sure the data value 0.463506493506493 is displayed as 463506493506493 instead of 0? (If you want to display more decimal places, you can change the {value|0} to {value|4}.)
To double check, would you mind to change the "addTitle" line to the following line?
Call c.addTitle("" & VarType(baseDataArray(0)) & "=" & baseDataArray(0), "arialbd.ttf", 12)
The above will display what is in baseDataArray(0) including its data type and its value. You can then confirm if the tooltip for the 1st sector is consistent with your actual data value.
Regards
Peter Kwan |
Re: issues with Pie chart |
Posted by Dilip Agarwal on Aug-12-2013 21:22 |
|
Thanks Peter, actually data type was string, When convert with Cdbl then works fine |
|