DHTMLX Docs & Samples Explorer

Bar Chart properties

Configuration properties are set in the chart constructor. Some of them are mandatory, others - optional.

var barChart =  new dhtmlXChart({
    view:"bar",
    container:"chart_container",
    value:"#sales#"
})

Mandatory properties

  • container - the id of the html container where you want display a chart
  • view - the chart type
  • value - a property of dataset that chart represents

Optional properties

look and fill

  • alpha - the bar transparency
  • border - enables/disables bar borders
  • color - a fixed value or template for the bars color
  • gradient - the bars gradient
  • padding - an object that defines padding of chart content:
    • top - the top padding
    • bottom - the bottom padding
    • left - the left padding
    • right - the right padding
  • width - the width of bars
  • radius - the radius of bar rounding

item details

  • label - a template for item labels
  • tooltip - a template for item tooltips
  • legend - a template for element text in the legend block
    • width - the block width
    • align - the horizontal alignment of the block: “left”, “right” or “center”
    • valign - the vertical alignment of the block: “top”,“bottom” or “middle”
    • layout - a layout that defines text stretching in horizontal or vertical direction :“x” or “y”
    • marker - an object that defines markers in the details block
      • radius - defines the radius of markers
      • type - the marker shape
      • width - the marker width
      • height - the marker height
    • toggle - enables/disables the possibility to hide/show a graph by clicking on the graph legend item
    • values - the legend items

scales

  • origin - the scale origin (for vertical charts).
  • yAxis - the vertical scale:

'Vertical Bar' and 'Stacked Vertical Bar' personality

  • title - the scale title
  • color - the scale color
  • start - the mininum value
  • end - the maximum value
  • step - the scale step
  • template - a template for scale labels
  • lines - enables/disables horizontal lines for scale units

'Horizontal Bar' and 'Stacked Horizontal Bar' personality

  • title - the scale title
  • color - the scale color
  • template - a template for scale labels
  • lines - enables/disables vertical lines for scale units
  • xAxis - the horizontal scale

'Vertical Bar' and 'Stacked Vertical Bar' personality

  • title - the scale title
  • color - the scale color
  • template - a template for scale labels
  • lines - enables/disables vertical lines for scale units

'Horizontal Bar' and 'Stacked Horizontal Bar' personality

  • title - (string) the scale title
  • color - the scale color
  • start - (integer) the mininum value of the scale
  • end - (integer) the maximum value of the scale
  • step - (integer) the scale's step
  • template - () a template for scale labels
  • lines - (boolean) enables/disables horizontal lines for scale units

data manipulation

  • group - groups data by a certain property
  • sort - sorts dataset