@vaadin/charts 25.0.0-alpha16 → 25.0.0-alpha18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/src/styles/vaadin-chart-base-styles.js +394 -210
- package/src/vaadin-chart-mixin.d.ts +2 -2
- package/src/vaadin-chart-mixin.js +116 -26
- package/src/vaadin-chart.d.ts +2 -2
- package/src/vaadin-chart.js +5 -3
- package/web-types.json +4 -4
- package/web-types.lit.json +4 -4
|
@@ -186,7 +186,7 @@ export type ChartPointDropEvent = CustomEvent<{ point: Point; originalEvent: Cha
|
|
|
186
186
|
export type ChartPointDragEvent = CustomEvent<{ point: Point; originalEvent: ChartPointEvent }>;
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
|
-
* Fired when
|
|
189
|
+
* Fired when the minimum and maximum is set for the X axis.
|
|
190
190
|
*/
|
|
191
191
|
export type ChartXaxesExtremesSetEvent = CustomEvent<{
|
|
192
192
|
axis: Axis;
|
|
@@ -197,7 +197,7 @@ export type ChartXaxesExtremesSetEvent = CustomEvent<{
|
|
|
197
197
|
}>;
|
|
198
198
|
|
|
199
199
|
/**
|
|
200
|
-
* Fired when
|
|
200
|
+
* Fired when the minimum and maximum is set for the Y axis.
|
|
201
201
|
*/
|
|
202
202
|
export type ChartYaxesExtremesSetEvent = CustomEvent<{
|
|
203
203
|
axis: Axis;
|
|
@@ -28,6 +28,8 @@ import 'highcharts/es-modules/masters/modules/xrange.src.js';
|
|
|
28
28
|
import 'highcharts/es-modules/masters/modules/bullet.src.js';
|
|
29
29
|
import 'highcharts/es-modules/masters/modules/gantt.src.js';
|
|
30
30
|
import 'highcharts/es-modules/masters/modules/draggable-points.src.js';
|
|
31
|
+
import KeyboardNavigation from 'highcharts/es-modules/Accessibility/KeyboardNavigation.js';
|
|
32
|
+
import HTMLUtilities from 'highcharts/es-modules/Accessibility/Utils/HTMLUtilities.js';
|
|
31
33
|
import Pointer from 'highcharts/es-modules/Core/Pointer.js';
|
|
32
34
|
import Highcharts from 'highcharts/es-modules/masters/highstock.src.js';
|
|
33
35
|
import { get } from '@vaadin/component-base/src/path-utils.js';
|
|
@@ -57,7 +59,7 @@ Pointer.prototype.onDocumentMouseMove = function (e) {
|
|
|
57
59
|
// If we're outside, hide the tooltip
|
|
58
60
|
if (
|
|
59
61
|
chartPosition &&
|
|
60
|
-
(!tooltip || !tooltip.
|
|
62
|
+
(!tooltip || !tooltip.isSticky) &&
|
|
61
63
|
!chart.isInsidePlot(pEvt.chartX - chart.plotLeft, pEvt.chartY - chart.plotTop, {
|
|
62
64
|
visiblePlotOnly: true,
|
|
63
65
|
}) &&
|
|
@@ -68,6 +70,35 @@ Pointer.prototype.onDocumentMouseMove = function (e) {
|
|
|
68
70
|
}
|
|
69
71
|
};
|
|
70
72
|
|
|
73
|
+
// As the `mouseup` event is attached to the document element, the target will reference
|
|
74
|
+
// the instance of the `vaadin-chart` element instead of the element the event originated from.
|
|
75
|
+
// That causes some mishbehaviors, e.g. in a drilldown series, clicking in the point does not
|
|
76
|
+
// drills down the series in some cases.
|
|
77
|
+
// Change to check for the first element in the composed path as the target of the event.
|
|
78
|
+
// Workaround for https://github.com/highcharts/highcharts/issues/23490
|
|
79
|
+
//
|
|
80
|
+
// TODO: Remove this monkeypatch once the referenced issue is fixed
|
|
81
|
+
const { simulatedEventTarget } = HTMLUtilities;
|
|
82
|
+
KeyboardNavigation.prototype.onMouseUp = function (e) {
|
|
83
|
+
delete this.isClickingChart;
|
|
84
|
+
if (!this.keyboardReset && e.relatedTarget !== simulatedEventTarget) {
|
|
85
|
+
const chart = this.chart;
|
|
86
|
+
const target = e.composedPath()[0];
|
|
87
|
+
if (!target || !chart.container.contains(target)) {
|
|
88
|
+
const curMod = this.modules && this.modules[this.currentModuleIx || 0];
|
|
89
|
+
if (curMod && curMod.terminate) {
|
|
90
|
+
curMod.terminate();
|
|
91
|
+
}
|
|
92
|
+
this.currentModuleIx = 0;
|
|
93
|
+
}
|
|
94
|
+
if (chart.focusElement) {
|
|
95
|
+
chart.focusElement.removeFocusBorder();
|
|
96
|
+
delete chart.focusElement;
|
|
97
|
+
}
|
|
98
|
+
this.keyboardReset = true;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
71
102
|
// Init Highcharts global language defaults
|
|
72
103
|
// No data message should be empty by default
|
|
73
104
|
Highcharts.setOptions({ lang: { noData: '' } });
|
|
@@ -301,11 +332,13 @@ export const ChartMixin = (superClass) =>
|
|
|
301
332
|
args.forEach((arg) => inflateFunctions(arg));
|
|
302
333
|
functionToCall.apply(this.configuration, args);
|
|
303
334
|
if (redrawCharts) {
|
|
335
|
+
const lang = Highcharts.defaultOptions.lang;
|
|
304
336
|
Highcharts.charts.forEach((c) => {
|
|
305
337
|
// Ignore `undefined` values that are preserved in the array
|
|
306
338
|
// after their corresponding chart instances are destroyed.
|
|
307
339
|
// See https://github.com/vaadin/flow-components/issues/6607
|
|
308
340
|
if (c !== undefined) {
|
|
341
|
+
c.time.lang = lang;
|
|
309
342
|
c.redraw();
|
|
310
343
|
}
|
|
311
344
|
});
|
|
@@ -449,7 +482,7 @@ export const ChartMixin = (superClass) =>
|
|
|
449
482
|
return options;
|
|
450
483
|
}
|
|
451
484
|
|
|
452
|
-
|
|
485
|
+
/*
|
|
453
486
|
* Name of the chart events to add to the configuration and its corresponding event for the chart element
|
|
454
487
|
* @private
|
|
455
488
|
*/
|
|
@@ -606,7 +639,6 @@ export const ChartMixin = (superClass) =>
|
|
|
606
639
|
* @param {Object} detail.originalEvent object with details about the event sent
|
|
607
640
|
* @param {Object} series Series object where the event was sent from
|
|
608
641
|
*/
|
|
609
|
-
legendItemClick: 'series-legend-item-click',
|
|
610
642
|
|
|
611
643
|
/**
|
|
612
644
|
* Fired when the mouses leave the graph.
|
|
@@ -654,7 +686,6 @@ export const ChartMixin = (superClass) =>
|
|
|
654
686
|
* @param {Object} detail.originalEvent object with details about the event sent
|
|
655
687
|
* @param {Object} point Point object where the event was sent from
|
|
656
688
|
*/
|
|
657
|
-
legendItemClick: 'point-legend-item-click',
|
|
658
689
|
|
|
659
690
|
/**
|
|
660
691
|
* Fired when the mouse leaves the area close to the point.
|
|
@@ -734,7 +765,7 @@ export const ChartMixin = (superClass) =>
|
|
|
734
765
|
get __xAxesEventNames() {
|
|
735
766
|
return {
|
|
736
767
|
/**
|
|
737
|
-
* Fired when
|
|
768
|
+
* Fired when the minimum and maximum is set for the x axis.
|
|
738
769
|
* @event xaxes-extremes-set
|
|
739
770
|
* @param {Object} detail.originalEvent object with details about the event sent
|
|
740
771
|
* @param {Object} axis Point object where the event was sent from
|
|
@@ -747,7 +778,7 @@ export const ChartMixin = (superClass) =>
|
|
|
747
778
|
get __yAxesEventNames() {
|
|
748
779
|
return {
|
|
749
780
|
/**
|
|
750
|
-
* Fired when
|
|
781
|
+
* Fired when the minimum and maximum is set for the y axis.
|
|
751
782
|
* @event yaxes-extremes-set
|
|
752
783
|
* @param {Object} detail.originalEvent object with details about the event sent
|
|
753
784
|
* @param {Object} axis Point object where the event was sent from
|
|
@@ -915,6 +946,8 @@ export const ChartMixin = (superClass) =>
|
|
|
915
946
|
} else {
|
|
916
947
|
this.configuration = Highcharts.chart(this.$.chart, options);
|
|
917
948
|
}
|
|
949
|
+
|
|
950
|
+
this.__forceResize();
|
|
918
951
|
}
|
|
919
952
|
|
|
920
953
|
/** @private */
|
|
@@ -928,7 +961,7 @@ export const ChartMixin = (superClass) =>
|
|
|
928
961
|
super.disconnectedCallback();
|
|
929
962
|
|
|
930
963
|
if (this.configuration) {
|
|
931
|
-
this._jsonConfigurationBuffer = this.configuration.userOptions;
|
|
964
|
+
this._jsonConfigurationBuffer = deepMerge({}, this.configuration.userOptions);
|
|
932
965
|
}
|
|
933
966
|
|
|
934
967
|
queueMicrotask(() => {
|
|
@@ -1120,6 +1153,7 @@ export const ChartMixin = (superClass) =>
|
|
|
1120
1153
|
this.__initSeriesEventsListeners(configuration);
|
|
1121
1154
|
this.__initPointsEventsListeners(configuration);
|
|
1122
1155
|
this.__initAxisEventsListeners(configuration, true);
|
|
1156
|
+
this.__initLegendItemClickEventListener(configuration);
|
|
1123
1157
|
this.__initAxisEventsListeners(configuration, false);
|
|
1124
1158
|
}
|
|
1125
1159
|
|
|
@@ -1138,6 +1172,39 @@ export const ChartMixin = (superClass) =>
|
|
|
1138
1172
|
this.__createEventListeners(this.__pointEventNames, configuration, 'plotOptions.series.point.events', 'point');
|
|
1139
1173
|
}
|
|
1140
1174
|
|
|
1175
|
+
/** @private */
|
|
1176
|
+
__initLegendItemClickEventListener(configuration) {
|
|
1177
|
+
const eventObject = this.__ensureObjectPath(configuration, 'legend.events');
|
|
1178
|
+
eventObject.itemClick = (event) => {
|
|
1179
|
+
const customEvent = {
|
|
1180
|
+
bubbles: false,
|
|
1181
|
+
composed: true,
|
|
1182
|
+
detail: {
|
|
1183
|
+
originalEvent: event,
|
|
1184
|
+
legend: event.target,
|
|
1185
|
+
},
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
// `event.legendItem` might be an object of type `Highcharts.Series`, `Highcharts.Point` or
|
|
1189
|
+
// `Highcharts.LegendItemObject`. We care only about the first two to dispatch either a
|
|
1190
|
+
// `series-legend-item-click` or `point-legend-item-click` event.
|
|
1191
|
+
const legendItemMatch = [
|
|
1192
|
+
{ clazz: Highcharts.Series, type: 'series' },
|
|
1193
|
+
{ clazz: Highcharts.Point, type: 'point' },
|
|
1194
|
+
].find(({ clazz }) => event.legendItem instanceof clazz);
|
|
1195
|
+
|
|
1196
|
+
if (legendItemMatch) {
|
|
1197
|
+
const { type: legendItemClickType } = legendItemMatch;
|
|
1198
|
+
customEvent.detail[legendItemClickType] = event.legendItem;
|
|
1199
|
+
this.dispatchEvent(new CustomEvent(`${legendItemClickType}-legend-item-click`, customEvent));
|
|
1200
|
+
|
|
1201
|
+
if (this._visibilityTogglingDisabled) {
|
|
1202
|
+
return false;
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1141
1208
|
/** @private */
|
|
1142
1209
|
__initAxisEventsListeners(configuration, isXAxis) {
|
|
1143
1210
|
let eventNames, axes;
|
|
@@ -1219,10 +1286,6 @@ export const ChartMixin = (superClass) =>
|
|
|
1219
1286
|
}
|
|
1220
1287
|
|
|
1221
1288
|
self.dispatchEvent(new CustomEvent(eventList[key], customEvent));
|
|
1222
|
-
|
|
1223
|
-
if (event.type === 'legendItemClick' && self._visibilityTogglingDisabled) {
|
|
1224
|
-
return false;
|
|
1225
|
-
}
|
|
1226
1289
|
};
|
|
1227
1290
|
}
|
|
1228
1291
|
}
|
|
@@ -1244,7 +1307,15 @@ export const ChartMixin = (superClass) =>
|
|
|
1244
1307
|
}
|
|
1245
1308
|
|
|
1246
1309
|
/** @private */
|
|
1247
|
-
__hasConfigurationBuffer(path) {
|
|
1310
|
+
__hasConfigurationBuffer(path, property) {
|
|
1311
|
+
if (
|
|
1312
|
+
property &&
|
|
1313
|
+
path.startsWith(property) &&
|
|
1314
|
+
this._jsonConfigurationBuffer &&
|
|
1315
|
+
Array.isArray(this._jsonConfigurationBuffer[property])
|
|
1316
|
+
) {
|
|
1317
|
+
return get(path.split('.')[1], this._jsonConfigurationBuffer[property][0]);
|
|
1318
|
+
}
|
|
1248
1319
|
return get(path, this._jsonConfigurationBuffer) !== undefined;
|
|
1249
1320
|
}
|
|
1250
1321
|
|
|
@@ -1296,7 +1367,7 @@ export const ChartMixin = (superClass) =>
|
|
|
1296
1367
|
|
|
1297
1368
|
/** @private */
|
|
1298
1369
|
__updateCategories(categories, config) {
|
|
1299
|
-
if (categories === undefined || !config || this.__hasConfigurationBuffer('xAxis.categories')) {
|
|
1370
|
+
if (categories === undefined || !config || this.__hasConfigurationBuffer('xAxis.categories', 'xAxis')) {
|
|
1300
1371
|
return;
|
|
1301
1372
|
}
|
|
1302
1373
|
|
|
@@ -1305,7 +1376,7 @@ export const ChartMixin = (superClass) =>
|
|
|
1305
1376
|
|
|
1306
1377
|
/** @private */
|
|
1307
1378
|
__updateCategoryMax(max, config) {
|
|
1308
|
-
if (max === undefined || !config || this.__hasConfigurationBuffer('xAxis.max')) {
|
|
1379
|
+
if (max === undefined || !config || this.__hasConfigurationBuffer('xAxis.max', 'xAxis')) {
|
|
1309
1380
|
return;
|
|
1310
1381
|
}
|
|
1311
1382
|
|
|
@@ -1319,7 +1390,7 @@ export const ChartMixin = (superClass) =>
|
|
|
1319
1390
|
|
|
1320
1391
|
/** @private */
|
|
1321
1392
|
__updateCategoryMin(min, config) {
|
|
1322
|
-
if (min === undefined || !config || this.__hasConfigurationBuffer('xAxis.min')) {
|
|
1393
|
+
if (min === undefined || !config || this.__hasConfigurationBuffer('xAxis.min', 'xAxis')) {
|
|
1323
1394
|
return;
|
|
1324
1395
|
}
|
|
1325
1396
|
|
|
@@ -1620,18 +1691,13 @@ export const ChartMixin = (superClass) =>
|
|
|
1620
1691
|
|
|
1621
1692
|
// If chart element is a flexible item the chartContainer should be flex too
|
|
1622
1693
|
if (isFlex) {
|
|
1623
|
-
this
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
style = this.getAttribute('style');
|
|
1627
|
-
if (!style.endsWith(';')) {
|
|
1628
|
-
style += ';';
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
style += 'display: flex;';
|
|
1632
|
-
this.setAttribute('style', style);
|
|
1694
|
+
this.style.display = 'flex';
|
|
1695
|
+
this.$.wrapper.style.display = 'flex';
|
|
1696
|
+
this.$.chart.style.flex = 1;
|
|
1633
1697
|
} else {
|
|
1634
|
-
this
|
|
1698
|
+
this.style.display = '';
|
|
1699
|
+
this.$.wrapper.style.display = '';
|
|
1700
|
+
this.$.chart.style.flex = '';
|
|
1635
1701
|
}
|
|
1636
1702
|
}
|
|
1637
1703
|
|
|
@@ -1640,6 +1706,30 @@ export const ChartMixin = (superClass) =>
|
|
|
1640
1706
|
console.warn(`<vaadin-chart> Acceptable values for "${propertyName}" are ${acceptedValues}`);
|
|
1641
1707
|
}
|
|
1642
1708
|
|
|
1709
|
+
/**
|
|
1710
|
+
* @private
|
|
1711
|
+
* Workaround for https://github.com/highcharts/highcharts/issues/23443
|
|
1712
|
+
* Forces a resize in the chart to make it calculate the labels positions
|
|
1713
|
+
* correctly in a chart with "organization" series
|
|
1714
|
+
*
|
|
1715
|
+
* TODO: Remove when the related ticket is fixed
|
|
1716
|
+
*/
|
|
1717
|
+
__forceResize() {
|
|
1718
|
+
const chart = this.configuration;
|
|
1719
|
+
const { options } = chart;
|
|
1720
|
+
const hasOrganizationSeries =
|
|
1721
|
+
options.chart.styledMode &&
|
|
1722
|
+
(options.chart.type === 'organization' || options.series.some((series) => series.type === 'organization'));
|
|
1723
|
+
if (!hasOrganizationSeries) {
|
|
1724
|
+
return;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
requestAnimationFrame(() => {
|
|
1728
|
+
chart.setSize(chart.chartWidth - 10, chart.chartHeight);
|
|
1729
|
+
chart.setSize(null, null);
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1643
1733
|
/** @private */
|
|
1644
1734
|
__onRedraw() {
|
|
1645
1735
|
this.__checkTurboMode();
|
package/src/vaadin-chart.d.ts
CHANGED
|
@@ -142,8 +142,8 @@ export * from './vaadin-chart-mixin.js';
|
|
|
142
142
|
* @fires {CustomEvent} point-drag-start - Fired when starting to drag a point.
|
|
143
143
|
* @fires {CustomEvent} point-drop - Fired when the point is dropped.
|
|
144
144
|
* @fires {CustomEvent} point-drag - Fired while dragging a point.
|
|
145
|
-
* @fires {CustomEvent} xaxes-extremes-set - Fired when
|
|
146
|
-
* @fires {CustomEvent} yaxes-extremes-set - Fired when
|
|
145
|
+
* @fires {CustomEvent} xaxes-extremes-set - Fired when the minimum and maximum is set for the X axis.
|
|
146
|
+
* @fires {CustomEvent} yaxes-extremes-set - Fired when the minimum and maximum is set for the Y axis.
|
|
147
147
|
*/
|
|
148
148
|
declare class Chart extends ChartMixin(ThemableMixin(ElementMixin(HTMLElement))) {
|
|
149
149
|
addEventListener<K extends keyof ChartEventMap>(
|
package/src/vaadin-chart.js
CHANGED
|
@@ -147,8 +147,8 @@ import { ChartMixin } from './vaadin-chart-mixin.js';
|
|
|
147
147
|
* @fires {CustomEvent} point-drag-start - Fired when starting to drag a point.
|
|
148
148
|
* @fires {CustomEvent} point-drop - Fired when the point is dropped.
|
|
149
149
|
* @fires {CustomEvent} point-drag - Fired while dragging a point.
|
|
150
|
-
* @fires {CustomEvent} xaxes-extremes-set - Fired when
|
|
151
|
-
* @fires {CustomEvent} yaxes-extremes-set - Fired when
|
|
150
|
+
* @fires {CustomEvent} xaxes-extremes-set - Fired when the minimum and maximum is set for the X axis.
|
|
151
|
+
* @fires {CustomEvent} yaxes-extremes-set - Fired when the minimum and maximum is set for the Y axis.
|
|
152
152
|
*
|
|
153
153
|
* @customElement
|
|
154
154
|
* @extends HTMLElement
|
|
@@ -178,7 +178,9 @@ class Chart extends ChartMixin(ThemableMixin(ElementMixin(PolylitMixin(LumoInjec
|
|
|
178
178
|
/** @protected */
|
|
179
179
|
render() {
|
|
180
180
|
return html`
|
|
181
|
-
<div id="
|
|
181
|
+
<div id="wrapper" style="height: 100%; width: 100%;">
|
|
182
|
+
<div id="chart" style="height: 100%; width: 100%;"></div>
|
|
183
|
+
</div>
|
|
182
184
|
<slot id="slot"></slot>
|
|
183
185
|
`;
|
|
184
186
|
}
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/charts",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha18",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
237
|
"name": "vaadin-chart",
|
|
238
|
-
"description": "`<vaadin-chart>` is a Web Component for creating high quality charts.\n\n### Basic use\n\nThere are two ways of configuring your `<vaadin-chart>` element: **HTML API**, **JS API** and **JSON API**.\nNote that you can make use of all APIs in your element.\n\n#### Using HTML API\n\n`vaadin-chart` has a set of attributes to make it easier for you to customize your chart.\n\n```html\n<vaadin-chart title=\"The chart title\" subtitle=\"The chart subtitle\">\n <vaadin-chart-series\n type=\"column\"\n title=\"The series title\"\n values=\"[10, 20, 30]\"\n ></vaadin-chart-series>\n</vaadin-chart>\n```\n\n> Note that while you can set type for each series individually, for some types, such as `'bar'`, `'gauge'` and `'solidgauge'`, you\n> have to set it as the default series type on `<vaadin-chart>` in order to work properly.\n\n#### Using JS API\n\nUse [`configuration`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
238
|
+
"description": "`<vaadin-chart>` is a Web Component for creating high quality charts.\n\n### Basic use\n\nThere are two ways of configuring your `<vaadin-chart>` element: **HTML API**, **JS API** and **JSON API**.\nNote that you can make use of all APIs in your element.\n\n#### Using HTML API\n\n`vaadin-chart` has a set of attributes to make it easier for you to customize your chart.\n\n```html\n<vaadin-chart title=\"The chart title\" subtitle=\"The chart subtitle\">\n <vaadin-chart-series\n type=\"column\"\n title=\"The series title\"\n values=\"[10, 20, 30]\"\n ></vaadin-chart-series>\n</vaadin-chart>\n```\n\n> Note that while you can set type for each series individually, for some types, such as `'bar'`, `'gauge'` and `'solidgauge'`, you\n> have to set it as the default series type on `<vaadin-chart>` in order to work properly.\n\n#### Using JS API\n\nUse [`configuration`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha18/#/elements/vaadin-chart#property-configuration) property to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\n\n// Wait for default configuration to be ready\nrequestAnimationFrame(() => {\n const configuration = chart.configuration;\n configuration.setTitle({ text: 'The chart title' });\n // By default there is one X axis, it is referenced by configuration.xAxis[0].\n configuration.xAxis[0].setCategories(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);\n configuration.addSeries({\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n });\n});\n```\n\n#### Using JS JSON API\n\nUse [`updateConfiguration`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha18/#/elements/vaadin-chart#method-updateConfiguration) method to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\nchart.updateConfiguration({\n title: {\n text: 'The chart title'\n },\n subtitle: {\n text: 'Subtitle'\n },\n xAxis: {\n categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n },\n series: [{\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n }]\n});\n```\n\n**Note:** chart style customization cannot be done via the JS or JSON API.\nStyling properties in the JSON configuration will be ignored. The following section discusses chart styling.\n\n### CSS Styling\n\nChart appearance is primarily controlled by CSS style rules.\nA comprehensive list of the supported style classes can be found at\nhttps://www.highcharts.com/docs/chart-design-and-style/style-by-css\n\nSee also the [Chart Styling](https://vaadin.com/docs/latest/components/charts/css-styling) documentation.\n\n### RTL support\n\n`vaadin-charts` as well as [Highcharts](https://www.highcharts.com/) by itself are not adjusting the layout\nbased on the `dir` attribute. In order to make `vaadin-charts` display RTL content properly additional\nJSON configuration should be used.\nEach chart should be updated based on the specific needs, but general recommendations are:\n\n 1. Set `reversed` to true for xAxis (https://api.highcharts.com/highcharts/xAxis.reversed).\n 2. Set `useHTML` to true for text elements, i.e. `tooltip` (https://api.highcharts.com/highcharts/tooltip.useHTML).\n 3. Set `rtl` to true for `legend` (https://api.highcharts.com/highcharts/legend.rtl).\n\n### Setting colors\n\nAlthough charts can be styled as described above, there is a simpler way for setting colors.\nColors can be set using CSS custom properties `--vaadin-charts-color-{n}` (where `n` goes from `0 - 9`).\n\nFor example `--vaadin-charts-color-0` sets the color of the first series on a chart.",
|
|
239
239
|
"attributes": [
|
|
240
240
|
{
|
|
241
241
|
"name": "category-max",
|
|
@@ -685,11 +685,11 @@
|
|
|
685
685
|
},
|
|
686
686
|
{
|
|
687
687
|
"name": "xaxes-extremes-set",
|
|
688
|
-
"description": "Fired when
|
|
688
|
+
"description": "Fired when the minimum and maximum is set for the x axis."
|
|
689
689
|
},
|
|
690
690
|
{
|
|
691
691
|
"name": "yaxes-extremes-set",
|
|
692
|
-
"description": "Fired when
|
|
692
|
+
"description": "Fired when the minimum and maximum is set for the y axis."
|
|
693
693
|
}
|
|
694
694
|
]
|
|
695
695
|
}
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/charts",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha18",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "vaadin-chart",
|
|
103
|
-
"description": "`<vaadin-chart>` is a Web Component for creating high quality charts.\n\n### Basic use\n\nThere are two ways of configuring your `<vaadin-chart>` element: **HTML API**, **JS API** and **JSON API**.\nNote that you can make use of all APIs in your element.\n\n#### Using HTML API\n\n`vaadin-chart` has a set of attributes to make it easier for you to customize your chart.\n\n```html\n<vaadin-chart title=\"The chart title\" subtitle=\"The chart subtitle\">\n <vaadin-chart-series\n type=\"column\"\n title=\"The series title\"\n values=\"[10, 20, 30]\"\n ></vaadin-chart-series>\n</vaadin-chart>\n```\n\n> Note that while you can set type for each series individually, for some types, such as `'bar'`, `'gauge'` and `'solidgauge'`, you\n> have to set it as the default series type on `<vaadin-chart>` in order to work properly.\n\n#### Using JS API\n\nUse [`configuration`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
103
|
+
"description": "`<vaadin-chart>` is a Web Component for creating high quality charts.\n\n### Basic use\n\nThere are two ways of configuring your `<vaadin-chart>` element: **HTML API**, **JS API** and **JSON API**.\nNote that you can make use of all APIs in your element.\n\n#### Using HTML API\n\n`vaadin-chart` has a set of attributes to make it easier for you to customize your chart.\n\n```html\n<vaadin-chart title=\"The chart title\" subtitle=\"The chart subtitle\">\n <vaadin-chart-series\n type=\"column\"\n title=\"The series title\"\n values=\"[10, 20, 30]\"\n ></vaadin-chart-series>\n</vaadin-chart>\n```\n\n> Note that while you can set type for each series individually, for some types, such as `'bar'`, `'gauge'` and `'solidgauge'`, you\n> have to set it as the default series type on `<vaadin-chart>` in order to work properly.\n\n#### Using JS API\n\nUse [`configuration`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha18/#/elements/vaadin-chart#property-configuration) property to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\n\n// Wait for default configuration to be ready\nrequestAnimationFrame(() => {\n const configuration = chart.configuration;\n configuration.setTitle({ text: 'The chart title' });\n // By default there is one X axis, it is referenced by configuration.xAxis[0].\n configuration.xAxis[0].setCategories(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);\n configuration.addSeries({\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n });\n});\n```\n\n#### Using JS JSON API\n\nUse [`updateConfiguration`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha18/#/elements/vaadin-chart#method-updateConfiguration) method to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\nchart.updateConfiguration({\n title: {\n text: 'The chart title'\n },\n subtitle: {\n text: 'Subtitle'\n },\n xAxis: {\n categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n },\n series: [{\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n }]\n});\n```\n\n**Note:** chart style customization cannot be done via the JS or JSON API.\nStyling properties in the JSON configuration will be ignored. The following section discusses chart styling.\n\n### CSS Styling\n\nChart appearance is primarily controlled by CSS style rules.\nA comprehensive list of the supported style classes can be found at\nhttps://www.highcharts.com/docs/chart-design-and-style/style-by-css\n\nSee also the [Chart Styling](https://vaadin.com/docs/latest/components/charts/css-styling) documentation.\n\n### RTL support\n\n`vaadin-charts` as well as [Highcharts](https://www.highcharts.com/) by itself are not adjusting the layout\nbased on the `dir` attribute. In order to make `vaadin-charts` display RTL content properly additional\nJSON configuration should be used.\nEach chart should be updated based on the specific needs, but general recommendations are:\n\n 1. Set `reversed` to true for xAxis (https://api.highcharts.com/highcharts/xAxis.reversed).\n 2. Set `useHTML` to true for text elements, i.e. `tooltip` (https://api.highcharts.com/highcharts/tooltip.useHTML).\n 3. Set `rtl` to true for `legend` (https://api.highcharts.com/highcharts/legend.rtl).\n\n### Setting colors\n\nAlthough charts can be styled as described above, there is a simpler way for setting colors.\nColors can be set using CSS custom properties `--vaadin-charts-color-{n}` (where `n` goes from `0 - 9`).\n\nFor example `--vaadin-charts-color-0` sets the color of the first series on a chart.",
|
|
104
104
|
"extension": true,
|
|
105
105
|
"attributes": [
|
|
106
106
|
{
|
|
@@ -441,14 +441,14 @@
|
|
|
441
441
|
},
|
|
442
442
|
{
|
|
443
443
|
"name": "@xaxes-extremes-set",
|
|
444
|
-
"description": "Fired when
|
|
444
|
+
"description": "Fired when the minimum and maximum is set for the x axis.",
|
|
445
445
|
"value": {
|
|
446
446
|
"kind": "expression"
|
|
447
447
|
}
|
|
448
448
|
},
|
|
449
449
|
{
|
|
450
450
|
"name": "@yaxes-extremes-set",
|
|
451
|
-
"description": "Fired when
|
|
451
|
+
"description": "Fired when the minimum and maximum is set for the y axis.",
|
|
452
452
|
"value": {
|
|
453
453
|
"kind": "expression"
|
|
454
454
|
}
|