@gitlab/ui
Version:
GitLab UI Components
101 lines (85 loc) • 2.48 kB
JavaScript
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
var script = {
data() {
return {
chart: null,
options: {
legend: {
show: false
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
// Generate the series with generateSeriesData() after
// https://gitlab.com/gitlab-org/gitlab-ui/-/issues/754
// gets implemented
series: [{
color: '#1f75cb',
data: [820, 932, 960, 1150, 1290, 1330, 1390],
name: 'Toggled Series 1',
showSymbol: true,
type: 'line'
}, {
color: '#108548',
data: [1640, 1864, 1920, 2300, 2580, 2660, 2780],
name: 'Series 2',
showSymbol: true,
type: 'line'
}]
}
};
},
computed: {
seriesData() {
return this.options.series.map(series => ({
type: 'solid',
name: series.name,
color: series.color,
data: series.data
}));
}
},
mounted() {
this.$nextTick(() => {
document.querySelector('#js-chart-legend [role=button]').click();
});
},
methods: {
onCreated(chart) {
this.chart = chart;
}
}
};
/* script */
const __vue_script__ = script;
/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('gl-chart',{attrs:{"options":_vm.options},on:{"created":_vm.onCreated}}),_vm._v(" "),(_vm.chart)?_c('gl-chart-legend',{attrs:{"id":"js-chart-legend","chart":_vm.chart,"series-info":_vm.seriesData}}):_vm._e()],1)};
var __vue_staticRenderFns__ = [];
/* style */
const __vue_inject_styles__ = undefined;
/* scoped */
const __vue_scope_id__ = undefined;
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
const __vue_is_functional_template__ = false;
/* style inject */
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__ = __vue_normalize__(
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
__vue_inject_styles__,
__vue_script__,
__vue_scope_id__,
__vue_is_functional_template__,
__vue_module_identifier__,
false,
undefined,
undefined,
undefined
);
export default __vue_component__;