Class SvgChartConfig

SvgChart config class.

Hierarchy

  • SvgChartConfig

Constructors

  • Creates a new SvgChartConfig instance with properties from parameter. Note: config parameter object is referenced.

    Parameters

    • Optional props: object

      Object with all non-default properties.

    Returns SvgChartConfig

Properties

ltr: boolean = true

Whether language direction is ltr.

series: ChartConfigSerie[] = null

Series array.

title: string = null

Title of chart.

chartType: ChartType = null

Chart type.

onXAxisLabelGroupSelect: XAxisColumnSelectedCallback = null

Callback when x axis label is selected. Parameters are SvgChart and x axis column index.

padding: {
    start: number;
    end: number;
    top: number;
    bottom: number;
    left: number;
    right: number;
} = ...

Padding object.

Type declaration

  • start: number
  • end: number
  • top: number
  • bottom: number
  • left: number

    Left will be set by code, depends on direction.

  • right: number

    Right will be set by code, depends on direction.

paddingDefault: number = 20

Default padding for space between elements.

legendWidth: number = 10

Width of legend squares or circles.

focusedValueShow: boolean = true

Whether the value box should be displayed when an element has focus.

onFocusedValueDisplay: FocusedValueCallback = null

Callback that returns a custom string to display when an item receives focus.

focusedCSSValueFill: string = 'black'

Fill color of focused value box.

focusedCSSValueColor: string = 'white'

Font color of focused value box.

focusedCSSValuePadding: string = '6px'

Padding of focused value box.

drawOnConfig: DrawCallback = null

Draw function to execute in the config phase. It receives a SvgChart and HTMLElement parameter.

Example

function(svgChart, groupNode) {
groupNode.appendChild(svgChart.el('rect', {
x: 10,
y: 10
}));
}
drawOnData: DrawCallback = null

Draw function to execute in the chart phase. It receives a SvgChart and HTMLElement parameter.

Example

function(svgChart, groupNode) {
groupNode.appendChild(svgChart.el('rect', {
x: 10,
y: 10
}));
}
fade: boolean = true

transition - Whether the chart elements should be faded in or nor.

backgroundColor: string = 'white'

Background color of the SVG element.

fontFamily: string = 'sans-serif'

Font fanily for all text elements.

titleFontSize: string | number = 'normal'

Fontsize for the title.

titleColor: string = 'black'

Font color of title.

titleHorizontalPosition: ChartPosition = ChartPosition.Center

Horizontal position of title. Can be one of: center, start, end.

titleVerticalPosition: ChartPosition = ChartPosition.Top

Vertical position of title. Can be one of: top, bottom, center.

maxValue: number = null

Maximum value. Required for charts with Y-axes.

minValue: number = null

Minumum value of Y axis. Required for charts with Y-axes.

axisTitleFontSize: string = 'smaller'

Font size of axes titles.

axisLabelFontSize: string = 'small'

Font size of axes labels.

xAxisTitle: string = null

X axis title.

xAxisTitleBottom: number = null

If this is a number X, than the x axis title will be positioned X pixels from the bottom. If this is null, then the title will be positioned paddingDefault pixesl from the bottom.

xAxisGridLineWidth: number = 1

Line width of the x axis grid.

xAxisGridLineColor: string = '#C0C0C0'

Color of x axis grid lines.

xAxisGridLineDashArray: string = '1 1'

Stroke dash array value for the x axis grid lines. See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray.

xAxisLabelColor: string = '#A0A0A0'

Font color of xaxis labels.

xAxisTitleColor: string = '#A0A0A0'

Font color of x axis title.

xAxisGrid: boolean = true

Whether the xaxis grid should be displayed.

xAxisGridPadding: number = 0

Outside padding for x axis grid.

xAxisLabels: boolean = true

Whether x axis labels should be displayed.

xAxisGridColumns: boolean = false

Whether the x axis labels should be below (false) or between (true) the x axis grid lines. For bar charts this will always be set to true.

xAxisGridColumnsSelectable: boolean = false

Whether xAxisGridColumns should be selectable. If this is true, the x axis labels can be clicked and selected.

xAxisGridSelectedColumnOpacity: number = 0.2

Opacity value for the selected xAxisGridColumn.

xAxisGridColumnsSelectableColor: string = 'black'

Background color for a selected xAxisGridColumn.

textAnchorXAxisLabels: string = 'middle'

The text anchor value for x axis labels. For example if you want vertical labels that should be aligned to the x axis, you can set this to 'start'. See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor.

xAxisLabelTop: number = 10

Number of pixels that the x axsis labels will be positioned from the bottom x axis grid line.

xAxisLabelRotation: number = 0

Degrees for the x axis labels.

xAxisStep: number = 1

Steps between x axis grid lines.

xAxisLabelStep: number = 1

Steps between x axis labels.

yAxisTitle: string = null
yAxisTitleStart: number = null

Number of pixels the y axis labels should be positioned from the start. If this is null, this will be defaultPadding pixels.

yAxisGridLineWidth: number = 1

Line width of the y axis grid.

yAxisGridLineColor: string = '#C0C0C0'

Color of y axis grid lines.

yAxisGridLineDashArray: string = '1 1'

Stroke dash array value for the y axis grid lines. See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray.

yAxisLabelColor: string = '#A0A0A0'

Font color of y axis labels.

yAxisTitleColor: string = '#A0A0A0'

Font color of y axis title.

yAxisStep: number = 10

Steps between y axis grid lines.

yAxisLabelStep: number = 10

Steps between y axis labels.

yAxisGrid: boolean = true

Whether the y axis grid should be displayed.

yAxisLabels: boolean = true

Whether y axis labels should be displayed.

yAxisGridPadding: number = 0

Outside padding for y axis grid.

legendFontSize: string = 'smaller'

Font size for legend labels.

legendColor: string = 'black'

Font color of legend labels.

legendCircle: boolean = false

Whether legends should be squares (false) or circles (true)

legend: boolean = true
legendSelect: boolean = true

Whether clicking on a legend hides and shows a the serie.

legendPosition: ChartPosition = ChartPosition.Top

Position of legend. Possible values: bottom, top, end.

legendBottom: number = null

If not null, number of pixels the legend should be positioned from the bottom. Otherwise a default number of pixels will be used.

legendTop: number = null
lineWidth: number = 2

Width of line for line charts.

pointRadius: number = 2

Radius of line points for line charts.

connectNullValues: boolean = false

Whether null values should be connected or not.

lineCurved: boolean = true

Whether lines should be curved or not.

lineChartFilled: boolean = false

Whether line charts should be filled or not.

points: boolean = true

Whether the lines should display points or not.

barFillOpacity: number = 0.5

Opacity of bars.

barSpacing: number = 4

Spacing in pixels between bars.

barStrokeWidth: number = 1

Width of bar border.

barStacked: boolean = false

Whether bars should be stacked.

pieFillOpacity: number = 0.6

Opacity of pie and donut charts.

donutWidth: number = null

With of donuts. Of not given a default value is used.

pieStroke: string = 'white'

Stroke color for pie charts.

pieStrokeWidth: number = 2

Width of stroke for pie charts. If this is 0, no stroke is painted.

donutStroke: string = 'white'

Stroke color for donut charts.

donutStrokeWidth: number = 2

Width of stroke for donut charts. If this is 0, no stroke is painted.

radarStrokeWidth: number = 2
radarFillOpacity: number = 0.3
bubbleMaxZValue: number = 100
bubbleFillOpacity: number = 0.5
bubbleStrokeWidth: number = 1
bubbleMaxRadius: number = null

Methods

  • Get direction string to use for dom direction attribute.

    Parameters

    Returns string

    Attribute value.

Generated using TypeDoc