Opened 9 years ago
Closed 9 years ago
#15005 closed defect (invalid)
[patch][cla] dojox.charting inside layout widgets
Reported by: | Martin Repta | Owned by: | cjolif |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | Charting | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
charting api does not work inside layout widgets such as BorderContainer?, TitlePane? etc.
It throws an error into browser console: Error: Invalid negative value for <rect> attribute width="-1"
Here is snippet of html code
<div style="border: solid black 1px;"> <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Pane #1'">I'm pane #1</div> <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Pane #2'">I'm pane #2</div> <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Pane #3', open: false"> I'm pane #3 <div id="pieChartThird"></div> </div> </div>
and here snippet of js code:
require([ "dojo/ready", "gjax/charting/Pie", "dojox/charting/Chart2D", "dojox/charting/themes/Claro", "dijit/TitlePane" ], function(ready, PieChart, Chart2D, theme){ ready(function(){ var makeDojoChart = function(node){ (new Chart2D(node)). setTheme(theme). addPlot("default", { type : "Pie", radius : 50, fontColor : "black", labelOffset : "-20" }). addSeries("January", [9420, 10126, 9803, 15965, 17290, 13165]). resize(200,200); }; makeDojoChart("pieChartThird"); }); });
This problem is caused by setting width and height of rendered svg node to zero values inside Chart.js/resize method
Patch file is attached.
Attachments (1)
Change History (4)
Changed 9 years ago by
Attachment: | charts.patch added |
---|
comment:1 Changed 9 years ago by
Component: | General → Charting |
---|---|
Owner: | set to Eugene Lazutkin |
Priority: | undecided → high |
Summary: | dojox.charting inside layout widgets → [patch][cla] dojox.charting inside layout widgets |
comment:2 Changed 9 years ago by
Owner: | changed from Eugene Lazutkin to cjolif |
---|---|
Status: | new → assigned |
comment:3 Changed 9 years ago by
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
If you want to use charting in widget, please use chart widget. It should work without any need for a fix. See: