简体   繁体   中英

Teechart for javascript; Reclaim unused space on right side

Using TeeChart for HTML5/Javascript; I'm am trying to find a way to get the chart area to expand into the unused space on the right hand side of a chart that has no right axis. Setting the right axis visible='false' doesn't work.

<html>
<head>
<script type="text/javascript" src="http://www.bankdynamics.com/teechart/src/teechart.js"></script>
<script type="text/javascript">

function DrawCharts()
{
var Chart1=new Tee.Chart(document.getElementById("ChartCanvas1"));
Chart1.addSeries(new Tee.Bar([0,0,0,0]) );
Chart1.addSeries(new Tee.Bar([0,0,0,0]) );

Chart1.title.visible=false;
Chart1.legend.visible=false;

Chart1.axes.left.visible=false;
Chart1.axes.right.visible=false;
Chart1.axes.bottom.visible=false;
Chart1.axes.top.visible=false;

Chart1.palette.colors[0] = "#626200";
Chart1.palette.colors[1] = "#800040";
Chart1.palette.colors[2] = "#00a8a8";
Chart1.palette.colors[3] = "#8080c0";

Chart1.panel.transparent=true;

var OutFlowsSeries = Chart1.series.items[0];
var  InFlowsSeries = Chart1.series.items[1];

OutFlowsSeries.marks.style="label";
 InFlowsSeries.marks.style="label";

OutFlowsSeries.colorEach="yes";
 InFlowsSeries.colorEach="yes";

 InFlowsSeries.data.values[0] =  2;
OutFlowsSeries.data.values[0] = -2;

 InFlowsSeries.data.values[1] =  1;
OutFlowsSeries.data.values[1] = -1;

 InFlowsSeries.data.values[2] =  4;
OutFlowsSeries.data.values[2] = -4;

 InFlowsSeries.data.values[3] =  3;
OutFlowsSeries.data.values[3] = -3;

Chart1.draw();
}
</script>

</head>

<body onLoad="DrawCharts();">

<canvas id="ChartCanvas1" width="700" height="200" style="border:1px solid black;">
(This browser does not support HTML5 Canvas feature)
</canvas>

</body>

</html>

We've just fixed this. Please, write to "info at steema dot com" asking for the new js.

Besides, note there's another setting that controls the percent space at each chart edge, that can be set to zero:

var m=Chart1.panel.margins; m.left=m.right=m.top=m.bottom=0;

Steema Support Team.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM