亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

用于導入文本文件的 Highcharts 區域功能

用于導入文本文件的 Highcharts 區域功能

偶然的你 2023-10-20 09:19:13
我試圖讓圖表中的區域在值超過特定閾值時改變顏色。這是我的圖表:Highchart 資源有一個如何執行此操作的示例:https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/series/color-zones-simple/然而,我的問題是,當您的 Highchart 從文本文件導入數據時,我無法在任何地方找到如何執行此操作的示例。我對圖表的樣式設置得相當嚴格,所以這是我的 highchart 代碼片段:$(function () {    // Load the fontsHighcharts.createElement('link', {   href: 'http://fonts.googleapis.com/css?family=Signika:400,700',   rel: 'stylesheet',   type: 'text/css'}, null, document.getElementsByTagName('head')[0]);// Add the background image to the containerHighcharts.wrap(Highcharts.Chart.prototype, 'getContainer', function (proceed) {   proceed.call(this);   this.container.style.background =null;});Highcharts.theme = {    colors: ['#5B8256'],    chart: {    backgroundColor: null,    style: {    fontFamily: "Arial, Helvetica, sans-serif"},    plotBorderColor: '#606063'},    title: {    style: {    color: '#eeeeee',    fontSize: '16px',    fontWeight: ''}},    subtitle: {    style: {    color: '#eeeeee'}},    tooltip: {    backgroundColor: 'rgba(0, 0, 0, 0.85)',    style: {color: '#F0F0F0'},    borderWidth: 0},    legend: {    itemStyle: {    fontWeight: 'bold',    fontSize: '13px'}},    xAxis: {    labels: {    style: {    color: '#eeeeee'}}},    yAxis: {    labels: {    style: {    color: '#eeeeee'}}},    plotOptions: {    series: {shadow: true},    marker: {lineColor: '#333'},    candlestick: {lineColor: '#404048'},    map: {shadow: false}},    navigator: {    xAxis: {gridLineColor: '#D0D0D8'}},    rangeSelector: {    buttonTheme: {fill: '#eeeeee',stroke: '#C0C0C8','stroke-width': 1,    states: {    select: {fill: '#D0D0D8'}}}},    scrollbar: {trackBorderColor: '#eeeeee'},    background2: null};任何為我指明正確方向的幫助將不勝感激。
查看完整描述

1 回答

?
精慕HU

TA貢獻1845條經驗 獲得超8個贊

您可以通過繪圖選項添加區域,例如:


    plotOptions: {

        series: {

            zones: [{

                value: 20,

                color: '#7cb5ec'

            }, {

                color: '#90ed7d'

            }],

            ...

        }

    }

現場演示: https://jsfiddle.net/BlackLabel/5w9rvonz/


API 參考: https: //api.highcharts.com/highcharts/plotOptions.series.zones


查看完整回答
反對 回復 2023-10-20
  • 1 回答
  • 0 關注
  • 122 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號