Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Issue: PieChart doesn't render all segments correctly [27373]

$
0
0
AjaxToolkit Version: 4.1.7.123
Using IE9.

When populating the PieChart via code if a segment covers more than approx 50% then it isn't displayed correctly.

Code:

string[] surveyItems = new string[3] { "Yes", "No", "Don't Know" };
int[] surveyAnswers = new int[3] { 1, 5, 1 };

for (int i = 0; i < 3; i++)
{
PieChartValue pcv = new PieChartValue();
pcv.Category = surveyItems[i].ToString();
pcv.Data = surveyAnswers[i];
PieChart1.PieChartValues.Add(pcv);
}

This issue can also be replicated by 'hardcoding' the values in the aspx page.

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:PieChart ID="PieChart1" runat="server">
<PieChartValues>
<asp:PieChartValue Category="Yes" Data="1" PieChartValueColor=""
PieChartValueStrokeColor="" />
<asp:PieChartValue Category="No" Data="5" PieChartValueColor=""
PieChartValueStrokeColor="" />
<asp:PieChartValue Category="Don't Know" Data="1" PieChartValueColor=""
PieChartValueStrokeColor="" />
</PieChartValues>
</asp:PieChart>



Comments: To fix this bug insert this code: ``` var dataVal = Math.abs(parseFloat(me._pieChartClientValues[index].Data)); if (dataVal > totalValue / 2) { arc = 1; } else { arc = 0; } ``` in file [\Server\AjaxControlToolkit\PieChart\PieChart.pre.js](https://ajaxcontroltoolkit.codeplex.com/SourceControl/latest#Server/AjaxControlToolkit/PieChart/PieChart.pre.js) and function __drawSegments__ before this line: ``` // ...here... me._parentDiv.innerHTML = me._parentDiv.innerHTML.replace('</svg>', '')......... ```

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>