Wednesday, 15 August 2012

javascript - ZingCharts horizonal stacked bar chart X-Axis labels being cut off -


I have created a simple horizontal bar chart, the labels are being disconnected on X-X as shown in the snippet below . I need to show the full label of 'X axis row A'. I tried to change the width of the chart but it does not help

  & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; ZingChart & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "chartDiv" & gt; & Lt; / Div & gt; & Lt; Script src = 'http: //cdn.zingchart.com/zingchart.min.js'> & Lt; / Script & gt; & Lt; Script & gt; Var chartData = {"type": "hbar", "stacked": true, "stack-type": "normal", // "100%" "title" also accepts: {"text": "X -xis row {"X-X roubee", "X axis line A"],}, "scale-y": {"format": "% v" "" "", "series": [ "Background-color": "RGB (248,51,45)", "text": "negative", "value": [-11, -22]}, {"background color": "RGB (120,152,55) ), "Text": "positive", "value": [35,45]}]}}; Window.onload = function () {var x = zingchart.render ({id: 'chartDiv', height: 200 , Width: 600, data: chartdata});} & lt; / script> & lt; / body & gt; & lt; / html & gt;  

So I finally put it in. If you use the 'plotware' key you can specify marginalized. For example:

< Example:

"Plotware": {"Margin": "40px 20px 50px 100px"}

Snippet "data-lang =" js "data-hide =" wrong ">

  & lt ;; DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; ZingChart & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "chartDiv" & gt; & Lt; / Div & gt; & Lt; Script src = 'http: //cdn.zingchart.com/zingchart.min.js'> & Lt; / Script & gt; & Lt; Script & gt; Var chartData = {"type": "hbar", "stacked": true, "stack-type": "normal", // "100%" "title" also accepts: {"text": "Margin example "", "Plotware": {"margin": "40px 20px 50px 100px"}, "scale-x": {"value": ["x axis line b", "x axis line A"],}, "Scale": {"format": "% v%", "series": [{"background-color": "RGB (248,51,45)", "text": "negative", "value ": [- 11, -22]}, {" background-color ":" RGB (120,152,55) "," text ":" positive "," value ": [35,45]}]}}; Window.onload = function () {var x = zingchart.render ({id: 'chartDiv', height: 200, width: 600, data: chartdata}); } & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;  


No comments:

Post a Comment