[Solved] Get Chart series dynamic from JSON

0 Answers 5 Views
Chart
Per
Top achievements
Rank 1
Per asked on 20 Feb 2026, 08:32 PM

I have a NET core app and calling an external API fropm another site which returns anJSON that looks like this

[
  {
    "powerDeviceName": "Datarack",
    "powerDeviceUnitName": "Datarack Fas 1",
    "color": "red",
    "dateInfo": "2026-01-01T00:00:00",
    "consumption": "44.35"
  },
  {
    "powerDeviceName": "Datarack",
    "powerDeviceUnitName": "Datarack Fas 1",
    "color": "red",
    "dateInfo": "2026-01-02T00:00:00",
    "consumption": "44.38"
  },
  {
    "powerDeviceName": "Datarack",
    "powerDeviceUnitName": "Datarack Fas 1",
    "color": "red",
    "dateInfo": "2026-01-03T00:00:00",
    "consumption": "44.38"
  },
   {
    "powerDeviceName": "Datarack",
    "powerDeviceUnitName": "Datarack Fas 2",
    "color": "blue",
    "dateInfo": "2026-01-01T00:00:00",
    "consumption": "291.59"
  },
  {
    "powerDeviceName": "Datarack",
    "powerDeviceUnitName": "Datarack Fas 2",
    "color": "blue",
    "dateInfo": "2026-01-02T00:00:00",
    "consumption": "293.00"
  },
  {
    "powerDeviceName": "Datarack",
    "powerDeviceUnitName": "Datarack Fas 2",
    "color": "blue",
    "dateInfo": "2026-01-03T00:00:00",
    "consumption": "289.21"
  },
 {
    "powerDeviceName": "Datarack",
    "powerDeviceUnitName": "Datarack Fas 3",
    "color": "yellow",
    "dateInfo": "2026-01-01T00:00:00",
    "consumption": "228.62"
  },
  {
    "powerDeviceName": "Datarack",
    "powerDeviceUnitName": "Datarack Fas 3",
    "color": "yellow",
    "dateInfo": "2026-01-02T00:00:00",
    "consumption": "577.15"
  },
  {
    "powerDeviceName": "Datarack",
    "powerDeviceUnitName": "Datarack Fas 3",
    "color": "yellow",
    "dateInfo": "2026-01-03T00:00:00",
    "consumption": "295.35"
  }
]

From this I want to create a chart with series that matches the "powerDeviceUnitName" values (with the color from JSON) and the axis will list all dates in dateInfo The "value" for the chart is "consumption"

I didn't thought this should be any hard issue, but I can't find any example on Teleriks demos that have external JSON?

 

Anyone that can help me in the right direction?

Regards Pelle

No answers yet. Maybe you can help?

Tags
Chart
Asked by
Per
Top achievements
Rank 1
Share this question
or