Charts Examples
<ec-chart domain-type="time">
<ec-series-line data="[{"x":"2017-08-13T10:00:00.000Z","y":-16},{"x":"2017-08-14T10:00:00.000Z","y":24},{"x":"2017-08-15T10:00:00.000Z","y":-131},{"x":"2017-08-16T10:00:00.000Z","y":14},{"x":"2017-08-17T10:00:00.000Z","y":54},{"x":"2017-08-18T10:00:00.000Z","y":76}]"></ec-series-line>
</ec-chart>
<ec-chart domain-type="time" height="80">
<ec-series name="Data01" color="chart-02" data="[{"x":"2017-08-13T10:00:00.000Z","y":-16},{"x":"2017-08-14T10:00:00.000Z","y":24},{"x":"2017-08-15T10:00:00.000Z","y":-131},{"x":"2017-08-16T10:00:00.000Z","y":14},{"x":"2017-08-17T10:00:00.000Z","y":54},{"x":"2017-08-18T10:00:00.000Z","y":76}]"></ec-series>
<ec-series-line name="Data02" data="[{"x":"2017-08-13T10:00:00.000Z","y":16},{"x":"2017-08-14T10:00:00.000Z","y":-24},{"x":"2017-08-15T10:00:00.000Z","y":131},{"x":"2017-08-16T10:00:00.000Z","y":-14},{"x":"2017-08-17T10:00:00.000Z","y":-54},{"x":"2017-08-18T10:00:00.000Z","y":-76}]"></ec-series-line>
</ec-chart>
<ec-chart domain-type="time" height="80">
<ec-series-line data="[{"x":"2017-08-13T10:00:00.000Z","y":-16},{"x":"2017-08-14T10:00:00.000Z","y":24},{"x":"2017-08-15T10:00:00.000Z","y":-131},{"x":"2017-08-16T10:00:00.000Z","y":14},{"x":"2017-08-17T10:00:00.000Z","y":54},{"x":"2017-08-18T10:00:00.000Z","y":76}]"></ec-series-line>
</ec-chart>
<ec-chart domain-type="time" locale="ru">
<ec-series-line data="[{"x":"2017-08-13T10:00:00.000Z","y":-16},{"x":"2017-08-14T10:00:00.000Z","y":24},{"x":"2017-08-15T10:00:00.000Z","y":-131},{"x":"2017-08-16T10:00:00.000Z","y":14},{"x":"2017-08-17T10:00:00.000Z","y":54},{"x":"2017-08-18T10:00:00.000Z","y":76}]"></ec-series-line>
</ec-chart>
<ec-chart domain-type="time" strategy-min="reasonable" strategy-max="reasonable">
<ec-series-line data="[{"x":"2017-08-13T10:00:00.000Z","y":17016},{"x":"2017-08-14T10:00:00.000Z","y":19024},{"x":"2017-08-15T10:00:00.000Z","y":16131},{"x":"2017-08-16T10:00:00.000Z","y":19014},{"x":"2017-08-17T10:00:00.000Z","y":18054},{"x":"2017-08-18T10:00:00.000Z","y":19076}]"></ec-series-line>
</ec-chart>
<ec-chart format-x="date">
<ec-series-column padding="0.5" data="[{"x":"2017-08-13T10:00:00.000Z","y":16},{"x":"2017-08-14T10:00:00.000Z","y":24},{"x":"2017-08-15T10:00:00.000Z","y":131},{"x":"2017-08-16T10:00:00.000Z","y":14},{"x":"2017-08-17T10:00:00.000Z","y":54},{"x":"2017-08-18T10:00:00.000Z","y":76}]"></ec-series-column>
</ec-chart>
<ec-chart domain-type="discrete" separate-y-axes>
<ec-series-column padding="0.5" name="Open on mobile" color="chart-01" data="[{"x":"Lead","y":462},{"x":"First","y":142},{"x":"Active","y":113},{"x":"Defecting","y":43},{"x":"Inactive","y":846}]"></ec-series-column>
<ec-series-line axis-y-right-group z-index="1" name="Open on mobile" color="chart-02" marker="true" data="[{"x":"Lead","y":-16},{"x":"First","y":24},{"x":"Active","y":-131},{"x":"Defecting","y":14},{"x":"Inactive","y":54}]"></ec-series-line>
</ec-chart>
<ec-chart domain-type="time" currency="USD">
<ec-series-line format-y="$," data="[{"x":"2017-08-13T10:00:00.000Z","y":-16},{"x":"2017-08-14T10:00:00.000Z","y":24},{"x":"2017-08-15T10:00:00.000Z","y":-131},{"x":"2017-08-16T10:00:00.000Z","y":14},{"x":"2017-08-17T10:00:00.000Z","y":54},{"x":"2017-08-18T10:00:00.000Z","y":76}]"></ec-series-line>
</ec-chart>
<ec-chart domain-type="time" id="customFormatter">
<ec-series-area id="customFormatterArea" data="[{"x":"2017-08-13T10:00:00.000Z","y":16},{"x":"2017-08-14T10:00:00.000Z","y":24},{"x":"2017-08-15T10:00:00.000Z","y":131},{"x":"2017-08-16T10:00:00.000Z","y":14},{"x":"2017-08-17T10:00:00.000Z","y":54},{"x":"2017-08-18T10:00:00.000Z","y":76}]"></ec-series-area>
</ec-chart>
<e-chart-loader></e-chart-loader>
<ec-chart domain-type="time">
<ec-series-line name="Data" data="[{"x":"2017-08-13T10:00:00.000Z","y":16},{"x":"2017-08-14T10:00:00.000Z","y":-24},{"x":"2017-08-15T10:00:00.000Z","y":131},{"x":"2017-08-16T10:00:00.000Z","y":-14},{"x":"2017-08-17T10:00:00.000Z","y":-54},{"x":"2017-08-18T10:00:00.000Z","y":-76}]"></ec-series-line>
</ec-chart>
interpolate="false"
<ec-chart domain-type="time">
<ec-series-line name="Data" interpolate="false" data="[{"x":"2017-08-13T10:00:00.000Z","y":16},{"x":"2017-08-14T10:00:00.000Z","y":-24},{"x":"2017-08-15T10:00:00.000Z","y":131},{"x":"2017-08-16T10:00:00.000Z","y":-14},{"x":"2017-08-17T10:00:00.000Z","y":-54},{"x":"2017-08-18T10:00:00.000Z","y":-76}]"></ec-series-line>
</ec-chart>
marker="true"
<ec-chart domain-type="time">
<ec-series-line name="Data" marker="true" data="[{"x":"2017-08-13T10:00:00.000Z","y":16},{"x":"2017-08-14T10:00:00.000Z","y":-24},{"x":"2017-08-15T10:00:00.000Z","y":131},{"x":"2017-08-16T10:00:00.000Z","y":-14},{"x":"2017-08-17T10:00:00.000Z","y":-54},{"x":"2017-08-18T10:00:00.000Z","y":-76}]"></ec-series-line>
</ec-chart>
<ec-chart domain-type="time">
<ec-series-area name="Data" data="[{"x":"2017-08-13T10:00:00.000Z","y":16},{"x":"2017-08-14T10:00:00.000Z","y":-24},{"x":"2017-08-15T10:00:00.000Z","y":131},{"x":"2017-08-16T10:00:00.000Z","y":-14},{"x":"2017-08-17T10:00:00.000Z","y":-54},{"x":"2017-08-18T10:00:00.000Z","y":-76}]"></ec-series-area>
</ec-chart>
<ec-chart domain-type="discrete">
<ec-series-column name="Data" data="[{"x":"Lead","y":462},{"x":"First","y":142},{"x":"Active","y":113},{"x":"Defecting","y":43},{"x":"Inactive","y":846}]"></ec-series-column>
</ec-chart>
<ec-chart domain-type="discrete">
<ec-series-column name="Data" data="[{"x":"Lead","y":462,"color":"chart-01"},{"x":"First","y":142,"color":"chart-02"}]"></ec-series-column>
</ec-chart>
<ec-chart height="196" format-x="date" domain-type="time">
<ec-series-stack name="Total">
<ec-series-stack-area order="5" color="chart-05" name="Area 5" data="[{"x":"2017-08-12T11:30:00.000Z","y":727}, {"x":"2017-08-13T11:30:00.000Z","y":1226}, {"x":"2017-08-14T11:30:00.000Z","y":1329}, {"x":"2017-08-15T11:30:00.000Z","y":267}, {"x":"2017-08-16T11:30:00.000Z","y":727}, {"x":"2017-08-17T11:30:00.000Z","y":1226}]"></ec-series-stack-area>
<ec-series-stack-area order="4" color="chart-04" name="Area 4" data="[{"x":"2017-08-12T11:30:00.000Z","y":2453}, {"x":"2017-08-13T11:30:00.000Z","y":2453}, {"x":"2017-08-14T11:30:00.000Z","y":267}, {"x":"2017-08-15T11:30:00.000Z","y":727}, {"x":"2017-08-16T11:30:00.000Z","y":1226}, {"x":"2017-08-17T11:30:00.000Z","y":1329}]"></ec-series-stack-area>
<ec-series-stack-area order="3" color="chart-03" name="Area 3" data="[{"x":"2017-08-12T11:30:00.000Z","y":244}, {"x":"2017-08-13T11:30:00.000Z","y":8264}, {"x":"2017-08-14T11:30:00.000Z","y":2472}, {"x":"2017-08-15T11:30:00.000Z","y":4434}, {"x":"2017-08-16T11:30:00.000Z","y":273}, {"x":"2017-08-17T11:30:00.000Z","y":727}]"></ec-series-stack-area>
<ec-series-stack-area order="2" color="chart-02" name="Area 2" data="[{"x":"2017-08-12T11:30:00.000Z","y":4326}, {"x":"2017-08-13T11:30:00.000Z","y":4434}, {"x":"2017-08-14T11:30:00.000Z","y":273}, {"x":"2017-08-15T11:30:00.000Z","y":727}, {"x":"2017-08-16T11:30:00.000Z","y":1226}, {"x":"2017-08-17T11:30:00.000Z","y":1329}]"></ec-series-stack-area>
<ec-series-stack-area order="1" color="chart-01" name="Area 1" data="[{"x":"2017-08-12T11:30:00.000Z","y":546}, {"x":"2017-08-13T11:30:00.000Z","y":433}, {"x":"2017-08-14T11:30:00.000Z","y":4184}, {"x":"2017-08-15T11:30:00.000Z","y":4434}, {"x":"2017-08-16T11:30:00.000Z","y":273}, {"x":"2017-08-17T11:30:00.000Z","y":727}]"></ec-series-stack-area>
</ec-series-stack>
</ec-chart>
<ec-chart height="196" format-x="date" domain-type="discrete">
<ec-series-group padding="0.5">
<ec-series-group-column order="5" color="chart-05" name="Column 5" data="[{"x":"2017-08-12T11:30:00.000Z","y":727}, {"x":"2017-08-13T11:30:00.000Z","y":1226}, {"x":"2017-08-14T11:30:00.000Z","y":1329}, {"x":"2017-08-15T11:30:00.000Z","y":267}, {"x":"2017-08-16T11:30:00.000Z","y":727}, {"x":"2017-08-17T11:30:00.000Z","y":1226}]"></ec-series-group-column>
<ec-series-group-column order="4" color="chart-04" name="Column 4" data="[{"x":"2017-08-12T11:30:00.000Z","y":2453}, {"x":"2017-08-13T11:30:00.000Z","y":2453}, {"x":"2017-08-14T11:30:00.000Z","y":267}, {"x":"2017-08-15T11:30:00.000Z","y":727}, {"x":"2017-08-16T11:30:00.000Z","y":1226}, {"x":"2017-08-17T11:30:00.000Z","y":1329}]"></ec-series-group-column>
<ec-series-group-column order="3" color="chart-03" name="Column 3" data="[{"x":"2017-08-12T11:30:00.000Z","y":244}, {"x":"2017-08-13T11:30:00.000Z","y":8264}, {"x":"2017-08-14T11:30:00.000Z","y":2472}, {"x":"2017-08-15T11:30:00.000Z","y":4434}, {"x":"2017-08-16T11:30:00.000Z","y":273}, {"x":"2017-08-17T11:30:00.000Z","y":727}]"></ec-series-group-column>
<ec-series-group-column order="2" color="chart-02" name="Column 2" data="[{"x":"2017-08-12T11:30:00.000Z","y":4326}, {"x":"2017-08-13T11:30:00.000Z","y":4434}, {"x":"2017-08-14T11:30:00.000Z","y":273}, {"x":"2017-08-15T11:30:00.000Z","y":727}, {"x":"2017-08-16T11:30:00.000Z","y":1226}, {"x":"2017-08-17T11:30:00.000Z","y":1329}]"></ec-series-group-column>
<ec-series-group-column order="1" color="chart-01" name="Column 1" data="[{"x":"2017-08-12T11:30:00.000Z","y":546}, {"x":"2017-08-13T11:30:00.000Z","y":433}, {"x":"2017-08-14T11:30:00.000Z","y":4184}, {"x":"2017-08-15T11:30:00.000Z","y":4434}, {"x":"2017-08-16T11:30:00.000Z","y":273}, {"x":"2017-08-17T11:30:00.000Z","y":727}]"></ec-series-group-column>
</ec-series-group>
</ec-chart>
<ec-chart domain-type="discrete">
<ec-series-column name="Data" highlight-last data="[{"x":"Lead","y":462},{"x":"First","y":142},{"x":"Active","y":113},{"x":"Defecting","y":43},{"x":"Inactive","y":846}]"></ec-series-column>
</ec-chart>
<ec-chart domain-type="discrete">
<ec-series-column name="Data" padding="0.5" data="[{"x":"Lead","y":462},{"x":"First","y":142},{"x":"Active","y":113},{"x":"Defecting","y":43},{"x":"Inactive","y":846}]"></ec-series-column>
</ec-chart>
<ec-chart height="196" format-x="date" domain-type="discrete">
<ec-series-stack padding="0.5" name="Total">
<ec-series-stack-column order="3" color="chart-03" name="Column 3" data="[{"x":"2017-08-12T11:30:00.000Z","y":727}, {"x":"2017-08-13T11:30:00.000Z","y":1226}, {"x":"2017-08-14T11:30:00.000Z","y":1329}, {"x":"2017-08-15T11:30:00.000Z","y":267}, {"x":"2017-08-16T11:30:00.000Z","y":727}, {"x":"2017-08-17T11:30:00.000Z","y":1226}]"></ec-series-stack-column>
<ec-series-stack-column order="2" color="chart-02" name="Column 2" data="[{"x":"2017-08-12T11:30:00.000Z","y":2453}, {"x":"2017-08-13T11:30:00.000Z","y":2453}, {"x":"2017-08-14T11:30:00.000Z","y":267}, {"x":"2017-08-15T11:30:00.000Z","y":727}, {"x":"2017-08-16T11:30:00.000Z","y":1226}, {"x":"2017-08-17T11:30:00.000Z","y":1329}]"></ec-series-stack-column>
<ec-series-stack-column order="1" color="chart-01" name="Column 1" data="[{"x":"2017-08-12T11:30:00.000Z","y":244}, {"x":"2017-08-13T11:30:00.000Z","y":8264}, {"x":"2017-08-14T11:30:00.000Z","y":2472}, {"x":"2017-08-15T11:30:00.000Z","y":4434}, {"x":"2017-08-16T11:30:00.000Z","y":273}, {"x":"2017-08-17T11:30:00.000Z","y":727}]"></ec-series-stack-column>
</ec-series-stack>
</ec-chart>
<ec-chart height="170" domain-type="time">
<ec-series-area name="Revenue" color="chart-02" data="[{"x":"2018-06-03","y":6700,"tooltip":{"x":"2018-06-03","y":"30000"}},{"x":"2018-06-04","y":18000,"tooltip":{"x":"2018-06-04"}},{"x":"2018-06-05","y":25651,"tooltip":{"x":"2018-06-05"}},{"x":"2018-06-06","y":20000,"tooltip":{"x":"2018-06-06"}},{"x":"2018-06-07","y":23852,"tooltip":{"x":"2018-06-07"}}]"></ec-series-area>
<ec-series-line name="Revenue" color="chart-01" line-style="dashed" data="[{"x":"2018-06-03","y":21218,"tooltip":{"x":"2017-06-03"}},{"x":"2018-06-04","y":22852,"tooltip":{"x":"2017-06-04"}},{"x":"2018-06-05","y":6800,"tooltip":{"x":"2017-06-05"}},{"x":"2018-06-06","y":26792,"tooltip":{"x":"2017-06-06"}},{"x":"2018-06-07","y":18000,"tooltip":{"x":"2017-06-07"}}]"></ec-series-line>
</ec-chart>
<ec-chart domain-type="time" tooltip-x-date-format="time" axis-x-date-format="time" format-x="date">
<ec-series-area name="Data" data="[{"x":"2017-08-13T13:00:00.000Z","y":16},{"x":"2017-08-14T12:00:00.000Z","y":-24},{"x":"2017-08-15T10:40:00.000Z","y":131},{"x":"2017-08-16T10:55:00.000Z","y":-14},{"x":"2017-08-17T15:00:40.000Z","y":-54},{"x":"2017-08-18T11:30:00.000Z","y":-76}]"></ec-series-area>
</ec-chart>
<ec-chart id="customtooltipvariation" height="170" domain-type="discrete">
<ec-series-column name="Name" padding="0.5" format-y=".1%" color="chart-01"></ec-series-column>
</ec-chart>
(function() {
var chart = document.getElementById('customtooltipvariation');
var series = chart.querySelector('ec-series-column');
series.data = [
{ x: 'Points', y: 0.61 },
{ x: 'Cash', y: 0.70 },
{ x: 'Discount', y: 0.55 },
{ x: 'Service', y: 0.90 },
{ x: 'Gift', y: 0.62 }
];
chart.customTooltip = {
'Points': {
rows: [
{ value: 2433567, label: 'Points delivered', type: 'header', valueFormat: { type: 'number' }, color: 'chart-04' },
{ label: 'Top points usages:' },
{
value: 0.81,
label: 'Cash Coupon',
valueFormat: {
type: 'number', options: { type: 'percent'}
},
color: 'chart-02'
},
{
value: 0.73,
label: 'Free Shipping',
valueFormat: {
type: 'number', options: { type: 'percent' }
}
},
{
value: 0.65,
label: 'Discount Coupon',
valueFormat: {
type: 'number', options: { type: 'percent' },
},
color: 'chart-03'
}
]
},
'Cash': {
rows: [
{ value: 567303, label: 'Cash delivered', type: 'header', valueFormat: { type: 'number' } },
{ label: 'Top cash usages:' },
{
value: 0.571,
label: 'Cash Coupon',
valueFormat: {
type: 'number', options: { type: 'percent'}
}
},
{
value: 0.75,
label: 'Free Shipping',
valueFormat: {
type: 'number', options: { type: 'percent' }
}
},
{
value: 0.85,
label: 'Discount Coupon',
valueFormat: {
type: 'number', options: { type: 'percent' }
}
}
]
},
'Discount': {
rows: [
{ value: 560790, label: 'Discount delivered', type: 'header', valueFormat: { type: 'number' } },
{ label: 'Top discount usages:' },
{
value: 0.63,
label: 'Cash Coupon',
valueFormat: {
type: 'number', options: { type: 'percent'}
}
},
{
value: 0.35,
label: 'Free Shipping',
valueFormat: {
type: 'number', options: { type: 'percent' }
}
},
{
value: 0.65,
label: 'Discount Coupon',
valueFormat: {
type: 'number', options: { type: 'percent' }
}
}
]
},
'Service': {
rows: [
{ value: 457032, label: 'Discount delivered', type: 'header', valueFormat: { type: 'number' } },
{ label: 'Top service usages:' },
{
value: 0.53,
label: 'Cash Coupon',
valueFormat: {
type: 'number', options: { type: 'percent'}
}
},
{
value: 0.58,
label: 'Free Shipping',
valueFormat: {
type: 'number', options: { type: 'percent' }
}
},
{
value: 0.85,
label: 'Discount Coupon',
valueFormat: {
type: 'number', options: { type: 'percent' }
}
}
]
},
'Gift': {
rows: [
{ value: 487092, label: 'Discount delivered', type: 'header', valueFormat: { type: 'number' } },
{ label: 'Top gift usages:' },
{
value: 0.45,
label: 'Cash Coupon',
valueFormat: {
type: 'number', options: { type: 'percent'}
}
},
{
value: 0.62,
label: 'Free Shipping',
valueFormat: {
type: 'number', options: { type: 'percent' }
}
},
{
value: 0.18,
label: 'Discount Coupon',
valueFormat: {
type: 'number', options: { type: 'percent' }
}
}
]
}
}
})();
The y value must be null
for this to work. Missing data can work with any chart type, but only line and area types have a proper visual representation of them.
<ec-chart domain-type="time">
<ec-series-area name="Data" data="[{"x":"2017-08-13T10:00:00.000Z","y":16},{"x":"2017-08-14T10:00:00.000Z","y":-24},{"x":"2017-08-15T10:00:00.000Z","y":131},{"x":"2017-08-16T10:00:00.000Z","y":null},{"x":"2017-08-17T10:00:00.000Z","y":-54},{"x":"2017-08-18T10:00:00.000Z","y":-76}]"></ec-series-area>
</ec-chart>