Skip to content

100_015_ResponsiveChart

Francois Vancoppenolle edited this page Jun 13, 2017 · 8 revisions

Previous Chapter          Previous Page          Next Page          Next Chapter          Table of content

Responsive Chart

By default, the size of the chart, is the size defined in the canvas description (Width and Height values); When the "responsive" option is activated, the size of the chart is automatically adapted to fit the width of the window (or the width of the DIV in which it is included).

REMARK : this option is not working when multiple charts are draw in a single canvas.

Contents

responsive

Description : make a chart responsive (<=> size is adapted automatically to the width of the window (or to the width of the DIV in which it is included)).

Chart types : All

Values : true or false

Default value : 'false'

Sample : responsive : true

See also :

responsiveWindowInitialWidth

Description : when a chart is responsive and when responsiveScaleContent option is set to true, by default, the width of the canvas as defined in your program will be considered as the normal scale. For instance, you define a canvas with a width of 1200 pixels in your program and a font size of 12 for the title. If your browser window has a width of 1200 pixels, the title will be drawn with a font size of 12. If your browser window has a width of 600 pixel, the title will be drawn with a font size of 6. If you prefer that the font size defined for the title (12 in previous sample) is 12 if your browser has a width of 600 when the chart is first displayed, set option responsiveWindowInitialWidth to true.

Chart types : All

Values : true or false

Default value : false

Sample : responsiveWindowInitialWidth : true

See also : responsiveScaleContent

responsiveMaxHeight

Description : when a chart is responsive, you can limit the maximum height of the chart with option responsiveMaxHeight.

Chart types : All

Values : positive integer value

Default value : 9999999 (<=> no maximum)

Sample : responsiveMaxHeight : 500

See also :

responsiveMaxWidth

Description : when a chart is responsive, you can limit the maximum width of the chart with option responsiveMaxWidth.

Chart types : All

Values : positive integer value

Default value : 9999999 (<=> no maximum)

Sample : responsiveMaxWidth : 500

See also :

responsiveMinHeight

Description : when a chart is responsive, you can limit the minimum height of the chart with option responsiveMinHeight.

Chart types : All

Values : positive integer value

Default value : 0 (<=> no minimum)

Sample : responsiveMinHeight : 500

See also :

responsiveMinWidth

Description : when a chart is responsive, you can limit the minimum width of the chart with option responsiveMinWidth.

Chart types : All

Values : positive integer value

Default value : 9999999 (<=> no maximum)

Sample : responsiveMinWidth : 500

See also :

responsiveScaleContent

Description : when a chart is responsive, by default, the font size of the text, the lines width and space options remains the same. You can force a rescaling of all parts by setting option responsiveScaleContent to true.

Chart types : All

Values : true or false

Default value : false

Sample : responsiveScaleContent : true

See also : responsiveWindowInitialWidth

##maintainAspectRatio

Description : when set to true, the ratio width/height is always kept. Otherwise, the height is set to the maximum of the height and the width to the maximum of the width.

Chart types : All

Values : true or false

Default value : true

Sample : maintainAspectRatio : false

See also :

##forcedAspectRatio

Description : The height of the canvas is specified through the height property of the canvas. if you want that the height is a percentage of the width, you can define it through option "forcedAspectRatio". If you set option forcedAspectRatio to 1, the height of the chart will be same as the width. If you set forcedAspectRatio to "0.5", the height of the chart will be the half of the width. You can set forcedAspectRatio to any positive value that you want. A value of 0 means that the height of the chart is the height specified in the canvas definition.

Chart types : All

Values : any positive value

Default value : 0

Sample : forcedAspectRatio: 1

See also : Canvas dimensions documentation.

Previous Chapter          Previous Page          Next Page          Next Chapter          Top of Page

Clone this wiki locally