scales

defines configuration of chart scales

object scales;

Example

var chart = new dhx.Chart("chart_container",{
    type:"area",
    scales: {
        "bottom" : {
            text: 'month'
        },
        "left" : {
            padding: 10,
            max: 90
        }
    },
    series: [
        {
           value: 'company A',
           strokeWidth: 2
           // more options   
        }
    ]
});

Details

The list of config options for scales

  • type - (string) the type of a scale: "left","right","top","bottom","radial" (see details below)
  • title - (string) sets a title for a scale
    Related sample:  Chart. Scale Title
  • text - (string) sets a template for labels of data items rendered on a scale
  • textTemplate - (function) sets a template for scale labels
    Related sample:  Chart. Text Template For Scale Labels
  • textPadding - (number) distance between labels of data items and the scale
  • showText - (boolean) shows/hides labels of data items on the scale
  • scalePadding - (number) distance between the scale and its title
  • hidden - (boolean) hides/shows the whole scale
  • grid - (boolean) shows/hides the grid lines (for x,y, or both scales). true by default for both scales (scales lines are shown). To hide both scales lines, you need to set grid:false in the configs of each scale
    Related sample:  Chart. Grid
  • dashed - (boolean) sets the dashed type for a scale. Use the dashed:true option in the configuration of the scale
    Related sample:  Chart. Dashed Grid
  • targetLine - (number) shows a threshold line (a target value); looks for the specified value in the data
    Related sample:  Chart. Target Line
  • targetValue - (number) allows setting a threshold line at any defined level (any number, not necessarily from the data)
    Related sample:  Chart. Target Value
  • max - (number) the maximal value of the Y scale
  • min - (number) the minimal value of the Y scale
  • log - (boolean) sets the Y scale as logarithmic
  • padding - (number) the padding between the values of the Y scale (area)
  • maxTicks - (number) sets the maximal number of ticks on the Y scale
  • size - (number) sets the padding between the scale and the chart container
  • locator - (string) points to the data property, the values of which should be rendered in the chart (used for Scatter chart only)

The radial scale is used for Radar chart and has its own properties, due to peculiarities of configuration:

  • radial scale
    • value - (string) the name of a data set property to take data values from (map to)
    • zebra - (boolean) sets a striped scale coloring for the Radar chart (alternation of two colors in a step)
    • showAxis - (boolean) renders values of the scale

Related sample:  Chart. Axis Configuration

See also
Back to top