Эта страница является
переводом страницы
API iRidi Line Chart. Перевод выполнен на 100%.
API iRidium. Line Chart
Line Chart is a graph of variable changes where dots - variable changes are connected with a line. Changes of several values can be displayed on a graph.
The documentation was updated on 09.11.2024
The function is available from 1.3.70 version
Line Chart is a graph of variable changes where dots - variable changes are connected with a line. Changes of several values can be displayed on a graph.
The chart displays values from the iRidium server database. Some Line Chart parameters are available for modification in the script.
Example
Download the example
Line Chart functions work with two projects: for the server (.sirpz file) and for a panel (.irpz file). The server gets a tag value and stores it in its database. A panel asks the server for data in a required time range and then displays them as a trend on the screen. Trend appearance is controlled in the script of a panel project (.irpz).
For projects to start successfully upload a server project to a real controller or a PC with launched iRidium server via iRidium transfer. A panel project can be uploaded to a real device or can be launched in the Emulator. Before launching a panel project set in it the correct IP address of the server:
Line Chart Object Methods
.SetScaleType(type)
requests data for a time range depending on the type - DAY, WEEK, MONTH
| On input |
Value |
Description
|
| type |
IR.TREND_SCALE_DAY |
type: number, requests data for the requested period
|
Trend.SetScaleType(IR.TREND_SCALE_DAY); //.SetScaleType(type) - Set scale type (day)
IR.Log(Trend.Range);
.SetValueLimits(min, max)
sets the maximum and minimum values to display on the Y axis
| On input |
Value |
Description
|
| min, max |
20, 100 |
type: number, scales the data axis
|
IR.GetItem("Page 1").GetItem("Item 2").SetValueLimits(20, 100); // обращение через GetItem("Item_Name")
It makes sense only when auto-scaling is disabled
.ShiftOnPixels(count, speed)
scrolls by the number of pixels. If count is positive - to the right, if negative - to the left; speed - scrolling speed in pixels >=0; If 0 - sharp movement, without smooth scrolling.
| On input |
Value |
Description
|
| count, speed |
-1000, 100 |
type: number, shifts the viewed area of the graph by the specified number of pixels at the specified speed
|
Trend.ShiftOnPixels(-1000, 100) //.ShiftOnPixels(count, speed) - swipe by the number of pixels. If count is positive - to the right, if count is negative - to the left; speed - speed of flipping in pixels >=0; If 0 - sharp movement, without smooth flipping.
.Reset()
resets the OX axis range to its original settings
Trend.Reset(); //.Reset() - reset to initial settings (Studio preset)
Свойства объекта
.Live
whether the trend is dynamic ("live"); Both reading and writing
| .Live |
1 |
type: number, sends a value of 1 if the rightmost point of the chart is in real time; sends a value of 0 if the viewing area is shifted to the chart history view
|
IR.GetPage("Page 1").GetItem("Item 3").Value = Trend.Live //.Live - dynamic trend ("live"); And read and write
.Range
range in iridi time. Reading and writing
| .Range |
0.04499999999825377 |
type: number, sets the range
|
Trend.Range = 0.045; //.Range - range (in iridium time); Both read and write