Opened 9 years ago
Closed 8 years ago
#15674 closed defect (invalid)
default: charting yAxis (NaN) title out of bounds
Reported by: | psiberia | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Charting | Version: | 1.8.0b1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Using the following code, the y-axis title appears nearly out of bounds of the chart. This is likely to the position being incorrectly calculated and returning a NaN with the following errors:
Unexpected value NaN parsing y attribute. Unexpected value matrix(-0.00000000,-1.00000000,1.00000000,-0.00000000,NaN,NaN) parsing transform attribute.
/ Code /
var chartTop = new Chart("chartTop", {
title: 'Chart Title', titlePos: 'top', top, bottom titleGap: '200', titleFont: 'normal normal normal 15pt Arial', titleFontColor: 'black'
});
chartTop.addPlot("default", {
type: "Lines", markers: false, enableCache: true, htmlLabels: false, hAxis: 'x', vAxis: 'y'
}) .addAxis("x", {
title: 'x axis', titleGap: 15, titleOrientation: 'away'
}) .addAxis("y", {
title: 'y axis', vertical: true, min: 0, max: 100, fixUpper: "major", fixLower: "major"
}) .setTheme(customTheme) .addSeries("Series A", [{x:1,y:3},{x:2,y:5},{x:3,y:6},{x:4,y:7},{x:5,y:7},{x:6,y:8},{x:7,y:4},{x:8,y:3},{x:9,y:7}], {
plot:'default', stroke: {width:1.25}
}) .render();
Attachments (2)
Change History (4)
Changed 9 years ago by
Attachment: | Screen Shot 2012-07-13 at 4.41.05 PM.png added |
---|
Changed 9 years ago by
Attachment: | Screen Shot 2012-07-13 at 4.44.14 PM.png added |
---|
rendered svg object, showing the NaN on the y positioning
comment:1 Changed 9 years ago by
I have identified the issue causing the NaN. It is also causing the chart title gap not set it self correctly ..
If the titleGap on the chart object is not an integer it causes the aforementioned issue. In my previous posted code it is a string. If I correctly set the property to an integer the chart y title renders and the correct gap is applied to the chart title.
comment:2 Changed 8 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
user error (use of string instead of number)
very top left you see the hints of the title on the y-Axis