翻譯|使用教程|編輯:吳園園|2019-09-02 11:23:51.027|閱讀 426 次
概述:本系列文章將為您介紹JavaScript圖表庫LightningChart JS交互示例,此示例顯示如何繪制樣式系列。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
LightningChart JS是Web上性能最高的圖表庫具有出色的執(zhí)行性能 - 使用高數(shù)據(jù)速率同時監(jiān)控數(shù)十個數(shù)據(jù)源。 GPU加速和WebGL渲染確保您的設(shè)備的圖形處理器得到有效利用,從而實現(xiàn)高刷新率和流暢的動畫。非常適合用于貿(mào)易,工程,航空航天,醫(yī)藥和其他領(lǐng)域的應(yīng)用。
首先使用圖表方法創(chuàng)建系列
// Add a spline series using default X and Y axes.const splineSeries = chart.addSplineSeries()
選項1:使用樣式對象進(jìn)行樣式設(shè)置。
系列樣式的第一個選項是創(chuàng)建一個新對象,其中包含有關(guān)可視設(shè)置的必要信息。對于行系列,對象必須是可見的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函數(shù)進(jìn)行樣式設(shè)置。
通常,簡單地修改組件的現(xiàn)有樣式可能更容易,而不是構(gòu)建新組件。這是使用所謂的mutator函數(shù)完成的。這是一個例子:
// Modify the previous Stroke style of a SplineSeries, by overriding its previous thickness. splineSeries.setStrokeStyle(strokeStyle => strokeStyle.setThickness(1.0))
我們的編碼實踐包括流暢的,自我返回的API,這使我們可以在一個語句中輕松調(diào)用多個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發(fā)布|附下載
=====================================================
如果你想LightningChart JS應(yīng)用于商業(yè)用途,歡迎。
關(guān)注下方的微信公眾號,及時獲取產(chǎn)品最新資訊▼▼▼
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: