ChartDesigner
Provides a settings panel to configure a Chart, with a live preview.
//<code-header>
fiddle.title = 'Chart designer';
//</code-header>
class QuarterlySales extends Model {
static fields = [{
name : 'quarter'
}, {
name : 'month',
type : 'number'
}, {
name : 'sku1',
type : 'number'
}, {
name : 'sku2',
type : 'number'
}];
}
const data = [
{ quarter : 'Q1', month : 1, sku1 : 3, sku2 : 5 },
{ quarter : 'Q2', month : 4, sku1 : 6, sku2 : 4 },
{ quarter : 'Q3', month : 7, sku1 : 4, sku2 : 7 },
{ quarter : 'Q4', month : 10, sku1 : 8, sku2 : 9 }
].map(data => new QuarterlySales(data));
new ChartDesigner({
appendTo : targetElement,
width : '100%',
height : '400px',
chartTitle : 'Sales',
chartSubtitle : 'By SKU, All Regions',
showSubtitle : true,
style : 'font-size: 14px',
data,
series : [
{
field : 'sku1',
label : 'Product 1'
},
{
field : 'sku2',
label : 'Product 2'
}
],
labelsSeriesOptions : [{
field : 'quarter',
label : 'Quarter'
}, {
field : 'month',
label : 'Month'
}]
});Requires one or more data series to be configured, as well as one or more data objects to provide data for the preview. See Chart for details on chart setup.
The designer is organized into three tabs:
- Layout: Choose the major chart type (line, bar, etc.) and chart components (title, legend).
- Data: Specify which data series will be used in the chart, and how.
- Appearance: Customize the look and feel of various chart components, including colors, fonts, and spacing.
Configs
136
Configs
136Common
Get/set the subtitle.
Get/set the title.
lineAlso a propertyGet/set which predefined chart type is selected in the designer. Options include
all types in chartType and additional pre-configured
subtypes such as lineWithPoints and barHorizontal.
Data
The sample data to use as data in the chart preview.
The series ID (field name) of the series currently selected for use as the labels series.
The currently selected series IDs (field names) for inclusion in the chart. See series.
The available series that can be chosen as the data series for the chart.
Layout
Whether to display in minimal mode, where chart preview occupies full area and settings panel is minimized.
Styling
Set the font families available for selection.
Axis styling
Chart elements
Content
CSS
DOM
Float & align
misc
Misc
Other
Scrolling
Series styling
Properties
123
Properties
123Common
Get/set the subtitle.
Get/set the title.
lineAlso a configGet/set which predefined chart type is selected in the designer. Options include
all types in chartType and additional pre-configured
subtypes such as lineWithPoints and barHorizontal.
Class hierarchy
Data
The sample data to use as data in the chart preview.
The series ID (field name) of the series currently selected for use as the labels series.
The currently selected series IDs (field names) for inclusion in the chart. See series.
The available series that can be chosen as the data series for the chart.
Layout
Whether to display in minimal mode, where chart preview occupies full area and settings panel is minimized.
Styling
Set the font families available for selection.