In Highcharts
, when I click
the View Data
in the extended toolbar, the Category
in the generated table cannot be translated.
hope to translate this
hope to translate this
hope to translate this
Highcharts.setOptions({
lang: {
viewFullscreen: '全画面表示',
printChart: 'グラフを印刷',
downloadJPEG: 'JPEG画像でダウンロード',
downloadPDF: 'PDF文書でダウンロード',
downloadPNG: 'PNG画像でダウンロード',
downloadSVG: 'SVG形式でダウンロード',
downloadCSV: 'CSV形式でダウンロード',
downloadXLS: 'XLS形式でダウンロード',
viewData: 'データテーブルを表示',
hideData: 'データテーブルを非表示',
noData: "データがありません"
},
noData: {
style: {
fontWeight: 'bold',
fontSize: '20px',
color: '#303030'
}
}
});
This value is equal to the title of the x-axis, so you can use the xAxis.title.text
property to set this text, and if you don't want it to be visible in the graph below the axis, you can set xAxis.title.enabled
to false
:
xAxis: {
title: {
text: 'カスタムテキスト',
enabled: false // to hide on chart
}
}
Demo: https://jsfiddle.net/BlackLabel/t79k8yfp/
API: https://api.highcharts.com/highcharts/xAxis.title.text
https://api.highcharts.com/highcharts/xAxis.title.enabled
Another way for other chart types that don't have axes, such as pie charts, is to use the exporting.csv.columnHeaderFormatter()
function:
exporting: {
csv: {
columnHeaderFormatter: function(item, key) {
if (!item || item instanceof Highcharts.Axis) {
return 'カスタムテキスト'
} else {
return item.name;
}
}
}
}
Demo: https://jsfiddle.net/BlackLabel/Lq20pgyh/
API: https://api.highcharts.com/highcharts/exporting.csv.columnHeaderFormatter