# Chart This module renders a dataset as an HTML-based chart representing the data. ## Usage ```jsx // import the component import ElementChart from 'calypso/my-sites/chart'; // And use it inline inside the render method of another component function render() { return ( ); } // Example Data Array /* [ { 'label': , // x-axis label 'value': , // bar value 'nestedValue': , // nested bar value or null if no nested bar 'className': , // classname(s) applied to bar container 'data': , // any data that you want to have access to in the barClick callback 'tooltipData': [ { label: , value: , link: , icon: , className: } ] } ] */ ``` ## Required Props - loading — Any truthy value indicates the chart is loading - data — An array of data objects using the format outlined above ## Optional Props - minTouchBarWidth — _default: 42_ The minimum bar width on touch devices - minBarWidth — _default: 15_ The minimum bar width on non-touch devices - barClick - The function to be called when a bar is clicked on the chart, it is passed the entire data object of the bar - minBarsToBeShown - The minimun no of bars to be shown - hideYAxis - _default: false_ A boolean value whether to hide the y-axis - hideXAxis - _default: false_ A boolean value whether to hide the x-axis