翻譯|使用教程|編輯:吳園園|2019-09-02 11:23:51.027|閱讀 426 次
概述:本系列文章將為您介紹JavaScript圖表庫LightningChart JS交互示例,此示例顯示如何繪制樣式系列。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
LightningChart JS是Web上性能最高的圖表庫具有出色的執行性能 - 使用高數據速率同時監控數十個數據源。 GPU加速和WebGL渲染確保您的設備的圖形處理器得到有效利用,從而實現高刷新率和流暢的動畫。非常適合用于貿易,工程,航空航天,醫藥和其他領域的應用。
首先使用圖表方法創建系列
// Add a spline series using default X and Y axes.const splineSeries = chart.addSplineSeries()
選項1:使用樣式對象進行樣式設置。
系列樣式的第一個選項是創建一個新對象,其中包含有關可視設置的必要信息。對于行系列,對象必須是可見的SolidLine類型。
// Create a new instance of visible solid line-style.const strokeStyle = new SolidLine() // Set desired fill style of the stroke. .setFillStyle( // SolidLine can have only SolidFill fill-style. new SolidFill().setColor(ColorRGBA(96, 204, 232)) ) // Set thinkness of the stroke. .setThickness(5.0)// Apply styling settings to the series. splineSeries.setStrokeStyle(strokeStyle)
選項2:使用mutator函數進行樣式設置。
通常,簡單地修改組件的現有樣式可能更容易,而不是構建新組件。這是使用所謂的mutator函數完成的。這是一個例子:
// Modify the previous Stroke style of a SplineSeries, by overriding its previous thickness. splineSeries.setStrokeStyle(strokeStyle => strokeStyle.setThickness(1.0))
我們的編碼實踐包括流暢的,自我返回的API,這使我們可以在一個語句中輕松調用多個setter。
splineSeries .setStrokeStyle(strokeStyle) // 'transparentFill' is a static constant that needs to be imported from the library in order to be used. // It is used to draw things with transparent fill that aren't disposable - like the points of a PointLineSeries. .setPointFillStyle(transparentFill)
推薦閱讀:
JavaScript圖表庫LightningChart JS最新版本v1.0.0發布|附下載
=====================================================
如果你想LightningChart JS應用于商業用途,歡迎。
關注下方的微信公眾號,及時獲取產品最新資訊▼▼▼
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: