gpt4 book ai didi

vue.js - Vue2-Highcharts setOptions 语言

转载 作者:行者123 更新时间:2023-12-02 00:30:00 26 4
gpt4 key购买 nike

我正在尝试使用 Vue2 对 highcharts 进行标准翻译,但我遇到了困难,因为我无法访问 setOptions 选项。我没有找到太多关于 Highcharts 的 vue2 文档,所以我在使用它时遇到了一些困难,如果有人也可以向我提供该内容,谢谢。

import VueHighcharts from 'vue2-highcharts'
export default{
components: {
VueHighcharts
},
props: ['title', 'subtitle', 'initoptions'],
data(){
let initOptions = JSON.parse(this.initoptions);
let tmpSeries = [];
let count = 0;

$.each(initOptions, function(key, value) {
let data = [];
$.each(value, function(key2, value2){
let date = key2.split('-');
data.push([Date.UTC(date[2], date[1], date[0]), value2]);
});

tmpSeries.push({'name': key, 'data': data});
count++;
});

return{
options: {
/* ***
I can not set this setOptions property to lang
*** */
lang: {
loading: 'Aguarde...',
months: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
weekdays: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'],
shortMonths: ['Jan', 'Feb', 'Mar', 'Abr', 'Maio', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
exportButtonTitle: "Exportar",
printButtonTitle: "Imprimir",
rangeSelectorFrom: "De",
rangeSelectorTo: "Até",
rangeSelectorZoom: "Periodo",
downloadPNG: 'Download imagem PNG',
downloadJPEG: 'Download imagem JPEG',
downloadPDF: 'Download documento PDF',
downloadSVG: 'Download imagem SVG'
},
chart: {
type: 'spline'
},
title: {
text: this.title || ''
},
subtitle: {
text: this.subtitle || ''
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
day:'%e/%m',
week:'%e/%m',
month: '%m/%y',
year: '%m'
},
title: {
text: 'Date'
}
},
yAxis: {
title: {
text: 'Total'
},
labels: {
formatter: function () {
return this.value;
}
}
},
tooltip: {
crosshairs: true,
shared: true
},
credits: {
enabled: false
},
plotOptions: {
spline: {
marker: {
radius: 8,
lineColor: '#666666',
lineWidth: 1
}
}
},
series: tmpSeries
}
}
}
}

希望有人能帮帮我,谢谢。

最佳答案

我不确定这个包但是 Official Vue Highcharts你可以像这样设置选项:

import Highcharts from 'highcharts';

import HighchartsMore from 'highcharts/highcharts-more';
HighchartsMore(Highcharts);

Highcharts.setOptions({
lang: {
decimalPoint: '.',
drillUpText: 'Back',
noData: "Check your options please",
resetZoom: 'Reset',
thousandsSep: ' '
}
});

import HighchartsVue from 'highcharts-vue';
Vue.use(HighchartsVue);

关于vue.js - Vue2-Highcharts setOptions 语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52278022/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com