翻譯|使用教程|編輯:吳園園|2020-01-09 16:30:37.917|閱讀 721 次
概述:數(shù)據(jù)可視化工具廣泛應(yīng)用于所有行業(yè)領(lǐng)域。此示例顯示了一個(gè)特定的業(yè)務(wù)案例,以可視化的方式將一個(gè)部門(mén)中虛構(gòu)的公司整個(gè)年度的成本可視化為一個(gè)交互式儀表板。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門(mén)軟控件火熱銷(xiāo)售中 >>
相關(guān)鏈接:
LightningChart JS是Web上性能最高的圖表庫(kù)具有出色的執(zhí)行性能 - 使用高數(shù)據(jù)速率同時(shí)監(jiān)控?cái)?shù)十個(gè)數(shù)據(jù)源。 GPU加速和WebGL渲染確保您的設(shè)備的圖形處理器得到有效利用,從而實(shí)現(xiàn)高刷新率和流暢的動(dòng)畫(huà)。非常適合用于貿(mào)易,工程,航空航天,醫(yī)藥和其他領(lǐng)域的應(yīng)用。
點(diǎn)擊下載LightningChart JS最新試用版
儀表板業(yè)務(wù)
儀表板 xy 欄 列 ui 行 日期時(shí)間
數(shù)據(jù)可視化工具廣泛應(yīng)用于所有行業(yè)領(lǐng)域。此示例顯示了一個(gè)特定的業(yè)務(wù)案例,以可視化的方式將一個(gè)部門(mén)中虛構(gòu)的公司整個(gè)年度的成本可視化為一個(gè)交互式儀表板。
儀表板布局
儀表板網(wǎng)格由4行2列創(chuàng)建。本示例中的某些可視化組件通過(guò)在創(chuàng)建過(guò)程中顯式提供行跨度和列跨度來(lái)填充多個(gè)單元格。
1、左上角的單元格。該單元格包含一個(gè)圖表,該圖表顯示使用通過(guò)SegmentSeries(不同于RectangleSeries)工具實(shí)現(xiàn)的條形圖或柱形圖顯示的每個(gè)部門(mén)每年的成本。段系列提供了通過(guò)指定起點(diǎn)和終點(diǎn)來(lái)自由創(chuàng)建和放置線段的功能。
// Create XY chart and attach to the dashboard. const barChart = dashboard.createChartXY({ columnIndex: 2, rowIndex: 0, columnSpan: 2, rowSpan: 1 }) // Add segment series to series individual line segments. // This series uses default axes. const bars = barChart.addSegmentSeries()段系列接受以下格式的輸入:{startX:number,startY:number,endX:number,endY:number}。該系列返回創(chuàng)建的線段,以提供進(jìn)一步修改的能力。圖表填充2行和1列。
// Add line segment. const column = bars.add({ startX: 10, startY: 10, endX: 20, endY: 20 })關(guān)于定制,可以將每列配置為具有單獨(dú)的樣式以及鼠標(biāo)和觸摸事件。每個(gè)圖表和系列都有鼠標(biāo)/觸摸事件。通過(guò)開(kāi)始鍵入“ onMouse”來(lái)搜索我們的API文檔。
// Configure the created bar column. column .setStrokeStyle( style => ... ) .onMouseEnter( () => pointerEnterHandler ) .onTouchEvent( () => pointerEnterHandler )2、右上方的單元格,上部。該單元格包含一個(gè)UI面板,該面板顯示了全年的公司總成本。UI面板只能顯示UI組件。圖表填充1行和1列。
// Create UI panel and attach to the dashboard. const panel = dashboard.createUIPanel({ columnIndex: 3, rowIndex: 1, columnSpan: 1, rowSpan: 1 }) // Add UI element specifying the builder. // E.g. CheckBox, Button, Legend, etc. panel.addUIElement(/* builder from the library */)3、右上方的單元格,下部。該單元格包含一個(gè)圖表,該圖表顯示了一年中每一天單個(gè)部門(mén)的唯一成本。該圖表將線形圖與通過(guò)將鼠標(biāo)移至條形圖中的列上方而收集的數(shù)據(jù)一起呈現(xiàn)。圖表填充1行和1列。
// Decide on an origin for DateTime axes. const dateTimeTickStrategy = AxisTickStrategies.DateTime(new Date(2018, 0, 1)) // Create a chart for visualizing the costs of selected department. // Specify DateTime format for x-axis labels. const lineChart = dashboard.createChartXY({ columnIndex: 2, rowIndex: 1, columnSpan: 1, rowSpan:1, chartXYOptions: { defaultAxisXTickStrategy: dateTimeTickStrategy } }) // Create line series for elected department. const lineSeries = lineChart.addLineSeries()3、底部單元格。該單元格包含一個(gè)圖表,該圖表顯示了全年所有公寓的總費(fèi)用的平滑線(使用SplineSeries)。圖表填充2行2列。
// Create a chart for visualizing the total costs of the company. // Specify DateTime format for x-axis labels similarly as before. const totalCostsChart = dashboard.createChartXY({ columnIndex: 0, rowIndex: 0, columnSpan: 2, rowSpan:2, chartXYOptions: { defaultAxisXTickStrategy: dateTimeTickStrategy } }) // Create line series for total costs of the company. const lineSeries = lineChart.addSplineSeries()**如果你想LightningChart JS應(yīng)用于商業(yè)用途,歡迎。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:LightningChart JS