SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

I am developing android app where i received data from pressure sensor(attached to arduino) and want to show it in scichart heatmap. i created succesfully scichart heatmap with IPaletteProvider. Now i want to update the heatmap with pressure sensor but currently i am unable to update my heatmap. Here is my Whole(PressureActivity code)code.

if (intent.getAction().equals(Constants.DATA)) {
String data = intent.getStringExtra(“DATA”);
if (data.contains(“ccccc”)) {
int index = data.indexOf(‘/’);
int indexx = data.indexOf(‘#’);
String d = data.substring((index + 1), indexx);
DoubleValues doubleValues=new DoubleValues(1);
doubleValues.add(Double.parseDouble(d));
dataSeries.updateZValues(doubleValues);
}
}

The above code is piece of android code where i actually received data from arduino and want to show it in heatmap so i update my dataSeries value. In my case
i use UniformHeatmapDataSeries<Integer, Integer, Double> dataSeries
But it did not work and shows only a rectangal of blue color and not updating with coming data.
Any one have any idea how to fix it.Thanks in advance.

Version
V2
  • You must to post comments
0
0

Hi there,

May I ask what size of heatmap do you you use ( size is passed as width and height into data series constructor ). I’m asking because your code creates a DoubleValues with single value then it is used for zValues of heatmap. This means that you code provides value only for single pixel and other values will remain with default values.

To fix it you need to ensure that you call updateZValues() with DoubleValues which have at least WIdth * Height elements ( only first Width * Height elements will be used to update heatmap ):

DoubleValues doubleValues=new DoubleValues();
for (int x = 0; x < w; x++) {
    for (int y = 0; y < h; y++) {
        doubleValues.add(value);
    }
}
dataSeries.updateZValues(doubleValues);

Or you can update them one by one with updateZAt but it will be slower because Java boxes each value which you pass in:

for (int x = 0; x < w; x++) {
    for (int y = 0; y < h; y++) {
        dataSeries.updateZAt(x, y, value);
    }
}

Hope that this will help you!

Best regards,
Yura

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.