Search results
Results from the WOW.Com Content Network
Now, what you can do is set the height of the parent element of the chart, so here div .chart is the parent of div #myChart. So, specifying the height of div .chart should just work fine. Consider the following code.
Just don't set the height property in HighCharts and it will handle it dynamically for you so long as you set a height on the chart's containing element. It can be a fixed number or a even a percent if position is absolute. Highcharts docs: By default the height is calculated from the offset height of the containing element
use chart.setSize(width, height, doAnimation = true); in your actual resize function to set the height and width dynamically; Set reflow: false in the highcharts-options and of course set height and width explicitly on creation. As we'll be doing our own resize event handling there's no need Highcharts hooks in another one.
The chart will default to the width and height of the containing element (see Google Visualization documentation for default values of height/width). The second is to not define the actual size of the element, and instead set the height/width of the chart to 500px each manually by adding those to your options:
What I need is basically change of width and height of chart. I tried to change height of pie-chart div but as a consequences only div height is changed without change of chart dimensions. If anyone know solution i would really appreciate.
Height: Gets or sets the height of a chart element. Width: Gets or sets the width of a chart element. X: Gets or sets the relative X-coordinate of the top-left corner of an applicable chart element. Y: Gets or sets the relative Y-coordinate of the top-left corner of an applicable chart element.
I know that I can set the height for the div but I have a solution that insert/remove axis/series dynamically in the chart and would be nice an auto height chart. The example is the same Candlestick/Volume demo from Highchart site, but without height property in the div container.
// Set cell size in pixels var cellSize = 30; chart.events.on("datavalidated", function(ev) { // Get objects of interest var chart = ev.target; var categoryAxis = chart.yAxes.getIndex(0); // Calculate how we need to adjust chart height var adjustHeight = chart.data.length * cellSize - categoryAxis.pixelHeight; // get current chart height var ...
which gives the exact desired height for height equals 431: Fixed height, set_aspect, automatically sized width and small margins. Ermmm, set_aspect messes things up again and prevents plt.tight_layout from actually removing the margins... this is an important use case that I don't have a great solution for yet.
I am using MPAndroidChart library to plot charts but I can't get the height right. No matter what value I put it remains a very compressed and not valid chart height. Would you be able to help out?