【问题标题】:Customizing tradingview charting_library header自定义 tradingview charting_library 标头
【发布时间】:2020-09-28 02:53:27
【问题描述】:

我目前已经完成了 tradingview 库的集成,并对样式的某些部分进行了初步定制。

当前css如下:

.chart-page .apply-common-tooltip, .chart-page .button.undo, .chart-page .button.redo,
.chart-page .symbol-edit-widget .symbol-edit-inputspacer input.symbol-edit {
    background: rgba(30,30,30,0.5) !important;
    /* background: blue !important; */
    border-color: #444 !important;
    color: #fff!important;
}
body, .chart-controls-bar, #footer-chart-panel{
    background-color: rgba(30,30,30,0.5) !important;
}
.chart-page .chart-container {
    background: none !important;
    border-color: #444 !important; 
}
.drawingToolbar-2CoOuCv8-{
    background-color: rgba(30,30,30,0.5);
}
.separator-3cgsM4c1-{
    background-color: #666;
}
a.button.getimage.apply-common-tooltip {
    background-color: #97999d !important;
}

我想要的是实际修改图表的标题面板,我似乎无法获得正确的 css 组合以使其更接近图表主体并在不破坏子项的情况下降低其高度。

以下是当前的屏幕截图,其中包含我想要自定义的位置。

【问题讨论】:

    标签: javascript css reactjs sass tradingview-api


    【解决方案1】:

    html.theme-light .group-wWM3zP_M- {
      background: #1E1E1F !important;
    }
    

    或黑暗

    html.theme-dark .group-wWM3zP_M- {
      background: #1E1E1F !important;
    }
    

    【讨论】:

      【解决方案2】:

      你应该配置新的css文件:

      var tvChart= new TradingView.widget(option);
      tvChart.onChartReady(function() {
          tvChart.addCustomCSSFile('css/my-custom-css.css')
      })
      

      并将您的新样式放入“my-custom-css.css”

      【讨论】:

        猜你喜欢
        • 2014-12-25
        • 2018-12-18
        • 2016-04-05
        • 2011-01-04
        • 1970-01-01
        • 1970-01-01
        • 2020-09-28
        • 2011-12-28
        • 2017-07-23
        相关资源
        最近更新 更多