Pre loader

Tag: Heatmap

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

2 votes
0 answers
9k views

Hi SciChart-Team!

This is more a feature than a support request but I could not find a more suitable place for it.

One of the strengths of SciCharts is its ability to select – use case dependend – the most appropriate resampling technique for drawing from a wide variety of options. Currently I depict a 2-dimensional empirical probablity density function (PDF) with the heatmap. The best way for a sub-/resampling would be a kind of “Sum”-Mode to represent the new “Cell-Count” and to prevent the disappearance of strongly localized, concentrated PDF-spikes if the window is scaled down. Maybe it is possible to implement such a resampling mode for the heatmap in a future release?

Due to the lack of a “Sum”-Mode I tried to use “Max”-Mode to keep the PDF-Spikes visible after scaling down but that didn’t worked as I expected. Was my expectation wrong? I know I can do it by myself and recalculate the PDF for the new heatmap size, create a new Heatmap2DArrayDataSeries … etc. but it would be nice if it would work out of the box.

Thanks!

Janko

1 vote
10k views

I would like to define two FastHeatMapRenderableSeries.ColorMap s. One in black and white for printing and the other one, … Why not just for the fun of it :D. How would I be able to switch between ColorMaps ( preferably through binding ) in wpf?

  • Michel Moe asked 9 years ago
  • last active 9 years ago
0 votes
11k views

I am using heatmaps in my application and would love to use the same color scheme that is used for those also in my xyz scatter plots. I know how to make palette providers I just don’t know how to get a specific color that is defined by a lineargradientbrush (defined in xaml) for a specific (relative value? 0.0-1.0 ). Is this possible?

0 votes
11k views

Hi,

Is there any way to get back the 2D data array from the Heatmap2DArrayDataSeries object?

Full of hope for positive answer,
Mark

0 votes
0 answers
10k views

Hi,

Is there any way to get the corresponding color value of Array2D from Heatmap2DArrayDataSeries? I try to create a histogram based on Heatmap.

Thanks,
Mark

0 votes
8k views

Hello,

I wanted to know if I can achieve interpolation of values within a heatmap. Is there any mechanism out-of-the-box?

Thank you very much.

Regards,
Sebastian

1 vote
6k views

Hi,

I am using the 2D heatmap as follows:

mData = new double[dataSize, dataSize];
DataSeries = new Heatmap2DArrayDataSeries<int, int, double>(mData, x => x, y => y);

In my application the displayed data size can be changed by the users – e.g. 200 x 300, but there is also a known maximum size – e.g. 500 x 500 for the data. Since I would like to avoid unnecessary large object allocations, is there a way for me to reuse the data buffer and display only the required data?

I tried setting the visible range over the data that would need to be displayed, which worked, but unfortunately the performance is still the same as when rendering the maximum size image. Is there any other way to achieve the goal?

  • Rok Rode asked 8 years ago
  • last active 8 years ago
0 votes
7k views

Hi,
I have a question regarding coloring on the Heatmap.

Is it possible to color the heatmap titles by some other other value than the data value, like Color? CustomColorProvider(x, y, data value, DataSeries)? We would like to color by “value order” and not the actual value, and have the actual values displayed as text on the titles. (I have tried to adjust the ColorMap GradientStops, but without success)

DataValues could be
[ 10.5, 12.5, 1.234E+150]
[ 1, 2, -1.234E+150]
[-10.5, -12.5, 1.234E-150]

This should result in 9 evenly spread colors.

Best regards
Peter Friis Hansen

  • pfh asked 8 years ago
  • last active 8 years ago
0 votes
0 answers
6k views

Hello,

I’ve been looking at the sample you provided for using the Heatmap 3D with orthogonal camera to make it look like a 2D Heatmap.

The example shows the axis labels on both left/right and top/bottom.

Is there a way to hide some of the labels and only leave one set of labels on each axis? (See image)

Also is there a way to hide the X,Y,Z Axis legend?

Thank you very much.

Best regards,
Sebastian

0 votes
0 answers
6k views

Hello,

I have another question on the Heatmap 3D.

I have attached a sample app to show what I’m trying to accomplish. Essentially, I want my data points to contain NaN whenever there’s no data available for it. In that way if I want I could find out which are the points that have no data and create an interpolation throughout those points.

The problem is that If I initialize all my data points to NaN, and then I add the actual valid data, that data won’t be shown in the heatmap. I suspect it has something to do with the GradientColorPalette that probably doesn’t know what to do with a NaN.

Can you help me solve this issue? Maybe I’m using the API in a wrong way.

NOTE: If you comment the code lines inside the HeatmapModel class where it is initializing the data points with NaN and run it, you should get all red and some thin lines of different colors, which would be the ones that contain actual data. The idea is that all the red is not colored and show empty space and only show the fine lines, because 0 is a valid value.

NOTE: due to limiting uploading size, you’ll have to add the SciChart DLLs to the project manually.

Thank you!
Best regards,
Sebastian

0 votes
0 answers
6k views

I’m trying to use the VertexSelectionModifier3D inside the example on Heatmap 3D with orthogonal camera. I also tried to follow the usage of said modifier through the “Simple Select Scatter Point 3D Chart” but am unable to make it work.

Of course, there isn’t an IsSelected property in the UniformGridDataSeries3D values, but it even doesn’t hit the DataSeriesChanged event when left clicking in the chart.

Here’s the usage:

< sc3D:VertexSelectionModifier3D ExecuteOn=”MouseLeftButton” ExecuteWhen=”None” >< /sc3D:VertexSelectionModifier3D >

I need to be able to select points (x,y,z) in the heatmap 3D.

Thank you very much.

Regards,
Sebastian

0 votes
10k views

Hi,
I’ve created a 2D Heatmap Chart which works for itself perfectly fine (incl. x-y zooming, panning, annotations, etc.), but once I’ve added a 3D chart (even without any datapoints), the behaviour of my Heatmap chart changes. After a double click on the chart, the displayed range changes. The zoom and pan direction works only in yDirection, new created annotations are not displayed correctly anymore, previous annotations disappear, when I try to move them.

Does anyone have an idea what the problem might be?

Each chart (2D Heatmap and 3D Pointcloud) has its own view and viewmodel.
In the images below you can see the 3D chart (which I more or less copied from the examples).
The image on the right shows the heatmap chart before I created the 3D chart view. During that phase everything works fine.
The image in the middle is showing the heatmap after the 3D chart view was created.
In the meantime there is not happening much in the code. There is a message that the 3D Libraries are initialized (“INITIALIZING NATIVE LIBS IN SC3DS CTOR”). That sounds quite normal to me.

Thanks in advance,

Tim

  • Tim asked 8 years ago
  • last active 8 years ago
0 votes
7k views

Hello again,

I’m working with the 2D Heatmap. I am setting the DrawMajorGridlines to true but they aren’t showing up. I then realized that I could set the Opacity of the series to something different than 1 and the gridlines are shown.

The problem with this is that I want my series background (i.e. all the places where my heatmap has no data double.NaN) to be shown in white, but setting the opacity to something different than 1 makes the background black.

I have tried to set the background to almost anything (Surface, Series, GridLinePanel) and it’s not affecting it.

Am I missing something?

I attach an image.

Thank you.
Kind regards,
Sebastian

1 vote
7k views

Hi,
I have a problem with 2D heatmap performace due to lots of data. I tried some tips to increase performance (rendering priority, resampling etc.) but it is insufficient. I read a scichart forum about 2D heatmap performance and I found answer about possible performance improvement in future (https://www.scichart.com/questions/question/heatmap-2d-performance). I would like to ask you if there is any performance improvement in newer scichart version. Actually I’m working with version 4.0.5.8187.

Thanks for your answer.

0 votes
10k views

Hi,

I’m trying to create Multi-Pane Heatmaps by using your example for multi-pane stock charts. I need to have one colormap per viewmodel and I think this should be bound to one HeatmapColourMap each to display the values of color.
So the ItemSource of SciChartGroup is ChartPaneViewModels which contains x number of Viewmodels where I add HeatMapRenderableSeriesViewModel with dataseries to ObservableCollection. Is this possible? I’m having some trouble displaying the correct colors for the data.

1 vote
7k views

Dear all, I am trying to export a heat map that I have generated that you can see at the right side of the attached image. However, the resulting XPS generated is the figure at the left. As one can see they are not very similar as one would expect. I have checked my code, but can’t seem to find the problem. Parts of my code are shown here to give more info. If anyone has tips why this strange result may occur , let me know please.

 <s:SciChartSurface x:Name="sciChart"  ChartTitle="Carbon and DBE">


       <s:SciChartSurface.RenderableSeries>
           <s:FastHeatMapRenderableSeries x:Name="heatmapSeries" Opacity="0.5" Maximum="100">
               <s:FastHeatMapRenderableSeries.ColorMap>
                   <LinearGradientBrush>
                       <GradientStop Offset="0" Color="DarkBlue"/>
                       <GradientStop Offset="0.2" Color="CornflowerBlue"/>
                       <GradientStop Offset="0.4" Color="DarkGreen"/>
                       <GradientStop Offset="0.6" Color="Chartreuse"/>
                       <GradientStop Offset="0.8" Color="Yellow"/>
                       <GradientStop Offset="1" Color="Red"/>
                   </LinearGradientBrush>
               </s:FastHeatMapRenderableSeries.ColorMap>
           </s:FastHeatMapRenderableSeries>

       </s:SciChartSurface.RenderableSeries> .
    </s:SciChartSurface>

and code

    double[,] a = x.Normalized2DArray(100);
                    Heatmap2DArrayDataSeries<double, double, double> heatmap = new Heatmap2DArrayDataSeries<double, double, double>(a, ix => (double)ix * x.binSizeX, iy => (double)iy * x.binSizeY);
                      heatmapSeries.DataSeries = heatmap;
          sciChart.ExportToFile(@"C:\Temp\chart.xps", ExportType.Xps, true, new Size(2000, 2000));
0 votes
9k views

In a previous project (matlab based) we have created charts as in the attached image.

This was previously done by adding all the points to a 2d histogram, this is a bit cumbersome as to give nice output the data needs to be resampled so that data points are equidistant at the display scale otherwise fast rises or falls (i.e. a small number of equi-time points). This approach becomes even worse if you want to enable interactive inspection of the plot instead of static as this will need to be recalculated for each zoom level.

Is there an easy way a similar effect in scichart without having to resort to manually creating 2d histograms. I was thinking there may be some option I can play with on how line series are rendered that might be able to generate this effect.

  • Hugoagogo asked 7 years ago
  • last active 7 years ago
0 votes
6k views

Hi all

I have looked at the examples (briefly) for heatmaps and it doesnt seem to work how I would like

I would like to be able to do a more basic uniform heatmap – such as the example below. Is this possible with SciCharts? If so, which series/chart type would be best to use

Many thanks

1 vote
7k views

I am looking to do some custom formatting of the Heatmap.

Is it possible to show no text if the values are the minimum, and format these buckets to a predefined colour e.g. transparent?

Then I am only showing those buckets with values.

I am using the HeatmapChartwithText as a basis for my prototype at the moment.

This thread looked promising but wasn’t quite what I was looking for, and this thread was last updated a year ago and couldn’t find anything else on the subject so figured it was worth re-asking…

0 votes
11k views

Hi,
I have the necessity to allow the user to draw one or several polygons upon a heatmap chart to let him select the region he is interested in. See attached image.

I don’t want to selected the markers inside the drawn polygon, only to know the coordinates (in data coordinates, not screen) of the various point that define the polygon.
I saw that the way to do this is to use Annotations however it’s not clear to me if is it possible to have the same behaviour of the BoxAnnotation but with a polygon (without any side number limit)?

Thank you,

Raphael

0 votes
6k views

Hi,

InvalidatateParentSurface does’t seem to update the text in the heatmap cell however the change seems to be detected and the color value is getting updated. Can you please suggest how to fix this?

Attached is a sample.

Thanks,
-Tom

  • mijothomas asked 7 years ago
  • last active 6 years ago
1 vote
6k views

I have been reading about the performance of the heatmap chart. In some post I have found that the heatmap was going to be redesign to improve the performance, someone knows if this have happened?

My issue is that I’m trying to implement the waterfall example, but my 2d array is 50 x 31000 and when I try to render in realtime (with a loop of 500ms or below) it goes extremely slow and the whole app doesn’t respond.
When I switch the ResamplingMode to “Max” it improves a slightly, however the chart start to show some black gaps and color stripes like the data is not rendered properly.

If I run the same example with an smaller array like 100 x 100 none of this happens.

am I hitting the the boundaries of what can be done with the heatmap?

Are there any suggestions to improve the performance? (I have tried the StockThickness=1 and AntiAliasing=false)

If it is useful I can post some code.

0 votes
10k views

Hi,

I’m trying to bind the maximum value of the HeatmapColorPalette in v5 in order to autorange the colormap to the data.

        <s:FastUniformHeatmapRenderableSeries x:Name="heatmapSeries" DataSeries="{Binding Data}" Opacity="0.9">
            <s:FastUniformHeatmapRenderableSeries.ColorMap>
                <s:HeatmapColorPalette Maximum="{Binding ColorMaximum}">
                    <s:HeatmapColorPalette.GradientStops>
                        <GradientStop Offset="0" Color="DarkBlue"/>
                        <GradientStop Offset="0.2" Color="CornflowerBlue"/>
                        <GradientStop Offset="0.4" Color="DarkGreen"/>
                        <GradientStop Offset="0.6" Color="Chartreuse"/>
                        <GradientStop Offset="0.8" Color="Yellow"/>
                        <GradientStop Offset="1" Color="Red"/>
                    </s:HeatmapColorPalette.GradientStops>
                </s:HeatmapColorPalette>
            </s:FastUniformHeatmapRenderableSeries.ColorMap>
        </s:FastUniformHeatmapRenderableSeries>

This previously worked in v4

            <s:FastHeatMapRenderableSeries x:Name="heatmapSeries" 
                                           DataSeries="{Binding Data}" 
                                           Opacity="0.9"
                                           Maximum="{Binding ColorMaximum}" 
                                           Minimum="{Binding ColorMinimum}"/>

The heatmap no longer refreshes to the new range when using the FastUniformHeatmapRenderableSeries instead of FastHeatMapRenderableSeries. Does anyone know why?

Regards,

  • Kevin Yeh asked 6 years ago
  • last active 6 years ago
0 votes
8k views

Hello
Do heatmap dataseries support logarithmic axes? i have a heatmap chart and a line (pic 1), which need to be drawn in logarithmic scale, but i get no heatmap chart and the line is drawn correctly (pic 2) when switch axis type to logarithmic. Something i’m likely to get is on pic 3 .
thanks in advance

0 votes
6k views

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.

  • mtg khan asked 6 years ago
  • last active 6 years ago
0 votes
11k views

I have created a HeatMap with the size of 25000 x 70. The application crashes with the following log:

E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
I/OpenGLRenderer: Initialized EGL, version 1.4
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without…
D/EGL_emulation: eglCreateContext: 0x7faef90b6500: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0x7faef90b6500: ver 2 0 (tinfo 0x7faf0489eec0)
D/EGL_emulation: eglMakeCurrent: 0x7faef90b6500: ver 2 0 (tinfo 0x7faf0489eec0)
D/EGL_emulation: eglCreateContext: 0x7faf04b65680: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0x7faf04b65680: ver 2 0 (tinfo 0x7faf04b7e500)
E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glTexImage2D:1908 GL error 0x501 A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x41a10f90 in tid 2736 (GLThread 973)


Below is Kotlin code from my sample project that produces the error:

private const val WIDTH = 25000
private const val HEIGHT = 70

class MainActivity : AppCompatActivity()
{
    private lateinit var chartBuilder: SciChartBuilder

    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)

        SciChartSurface.setRuntimeLicenseKey(getString(R.string.sciChart_license))
        SciChartBuilder.init(this)
        chartBuilder = SciChartBuilder.instance()

        setContentView(R.layout.activity_main)
        val background = findViewById<ViewGroup>(R.id.background)

        val chartSurface = createChartSurface()
        background.addView(chartSurface)

        addPoints(chartSurface)
    }

    private fun createChartSurface(): SciChartSurface
    {
        val surface = SciChartSurface(this)

        val xAxis = chartBuilder.newNumericAxis().build()
        val yAxis = chartBuilder.newNumericAxis().build()

        surface.xAxes.add(xAxis)
        surface.yAxes.add(yAxis)

        surface.renderableSeries.add(createSeries(WIDTH, HEIGHT))

        return surface
    }

    private fun createSeries(width: Int, height: Int): FastUniformHeatmapRenderableSeries
    {
        val dataSeries = UniformHeatmapDataSeries(Int::class.javaObjectType, Int::class.javaObjectType, Float::class.javaObjectType, width, height)

        return chartBuilder.newUniformHeatmap()
            .withColorMap(ColorMap(intArrayOf(ColorUtil.DarkBlue, ColorUtil.CornflowerBlue, ColorUtil.DarkGreen, ColorUtil.Chartreuse, ColorUtil.Yellow, ColorUtil.Red), floatArrayOf(0f, 0.2f, 0.4f, 0.6f, 0.8f, 1f)))
            .withDataSeries(dataSeries)
            .build()
    }

    private fun addPoints(chartSurface: SciChartSurface)
    {
        @Suppress("UNCHECKED_CAST")
        val dataSeries = chartSurface.renderableSeries.first().dataSeries as UniformHeatmapDataSeries<Int, Int, Float>

        val xRange = 0 until WIDTH

        for (i in 0 until HEIGHT)
        {
            val values = xRange.map { (i + it).toFloat() }
            dataSeries.updateRangeZAt(0, i, values)
        }

        val renderableSeries = chartSurface.renderableSeries.first() as FastUniformHeatmapRenderableSeries
        renderableSeries.minimum = dataSeries.zValues.minimum.toDouble()
        renderableSeries.maximum = dataSeries.zValues.maximum.toDouble()
    }
}
0 votes
6k views

I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support-dev.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)

However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

0 votes
0 answers
6k views

Hi,

I am playing with the heatmap chart and stumbled upon an IndexOutOfRange exception when updating the chart.

I initialise my chart where Height=2 and Width=3:

var data = new double[Height, Width]; // 2 rows, 3 columns
double d = 0.0;
for (int y = 0; y < Height; y++)
{
    for (int x = 0; x < Width; x++)
    {
        data[y, x] = d++;
    }
}

heatmapSeries.DataSeries = new UniformHeatmapDataSeries<int, int, double>(data, 0, 1, 0, 1);

Calling the following line returns 5 which is equivalent to getting the value with data[1,2] (all good so far):

dataseries.GetZValue(yIndex: 1, xIndex: 2);

Now let’s update that value to, say 7.1, with:

dataseries.UpdateZValue(xIndex: 2, yIndex: 1, zValue: 7.1);

Executing the above line throws an IndexOutOfRangeException. Looking at the source code, the UpdateZValue() method does:

_zValues[xIndex, yIndex] = zValue;
// ...

No wonder why the exception gets thrown… I reckon it should be _zValues[yIndex, xIndex] = zValue; (xIndex and yIndex swapped).

0 votes
9k views

I have created a heatmap chart with values for the data series with four vertical lines of width 1. When the width of data series is smaller than width of SciChartSurface in pixels the four lines are clearly visible. However when I increase the width of data series to be bigger than the width in pixels, then some lines disappear, even though I’ve set the re-sampling mode to ResamplingMode.Max.

I wasn’t able to attach images to the post (got a Forbidden error), so I’ve uploaded them to Imagur:
Missing Lines
Visible lines

Here is the code from which the screen shots were made:

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.scichart.charting.model.dataSeries.UniformHeatmapDataSeries
import com.scichart.charting.visuals.SciChartSurface
import com.scichart.charting.visuals.renderableSeries.ColorMap
import com.scichart.data.numerics.ResamplingMode
import com.scichart.drawing.utility.ColorUtil
import com.scichart.extensions.builders.SciChartBuilder
import kotlin.math.roundToInt

const val WIDTH = 2000
const val HEIGHT = 50

class MainActivity : AppCompatActivity()
{
    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)

        SciChartSurface.setRuntimeLicenseKey(getString(R.string.sciChart_license))
        SciChartBuilder.init(this)

        setContentView(R.layout.activity_main)

        val chartSurface = findViewById<SciChartSurface>(R.id.chart)
        val chartBuilder = SciChartBuilder.instance()

        val xAxis = chartBuilder.newNumericAxis().build()
        val yAxis = chartBuilder.newNumericAxis().build()

        val dataSeries = UniformHeatmapDataSeries<Int, Int, Int>(Int::class.javaObjectType, Int::class.javaObjectType, Int::class.javaObjectType, WIDTH, HEIGHT)
        for (x in 0 until WIDTH)
        {
            for (y in 0 until HEIGHT)
            {
                val value = when (x)
                {
                    0,
                    (0.25 * WIDTH).roundToInt(),
                    (0.5 * WIDTH).roundToInt(),
                    (0.75 * WIDTH).roundToInt() -> 50
                    else                        -> 0
                }
                dataSeries.updateZAt(x, y, value)
            }
        }

        val series = chartBuilder.newUniformHeatmap()
            .withDataSeries(dataSeries)
            .withColorMap(ColorMap(intArrayOf(ColorUtil.DarkBlue, ColorUtil.CornflowerBlue, ColorUtil.DarkGreen, ColorUtil.Chartreuse, ColorUtil.Yellow, ColorUtil.Red), floatArrayOf(0f, 0.2f, 0.4f, 0.6f, 0.8f, 1f)))
            .withResamplingMode(ResamplingMode.Max)
            .build()

        chartSurface.suspendUpdates().use {
            chartSurface.xAxes.add(xAxis)
            chartSurface.yAxes.add(yAxis)
            chartSurface.renderableSeries.add(series)
        }
    }
}
0 votes
8k views

I have created a SciChartSurface with the width of 200 px. I have created a data series with data that corresponds to four vertical lines at 0 %, 25 %, 50 % and 75 % of width. When I set the data series’ width to 115 points all four vertical lines are clearly visible. However when I set the width to 116 points or more, the first line (at x == 0) disappears. Data series is still smaller than the renderable series width in px, so there is no reason for any of the vertical lines to go missing. Is this a bug, or did I configure something wrong?

Here is the xml layout:

<com.scichart.charting.visuals.SciChartSurface
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/chart"
    android:layout_width="200px"
    android:layout_height="match_parent"/>

Here is the code for MainActivity:

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.scichart.charting.model.dataSeries.UniformHeatmapDataSeries
import com.scichart.charting.visuals.SciChartSurface
import com.scichart.charting.visuals.renderableSeries.ColorMap
import com.scichart.drawing.utility.ColorUtil
import com.scichart.extensions.builders.SciChartBuilder
import kotlin.math.roundToInt

const val WIDTH = 116
const val HEIGHT = 50

class MainActivity : AppCompatActivity()
{
    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)

        SciChartSurface.setRuntimeLicenseKey(getString(R.string.sciChart_license))
        SciChartBuilder.init(this)

        setContentView(R.layout.activity_main)

        val chartSurface = findViewById<SciChartSurface>(R.id.chart)
        val chartBuilder = SciChartBuilder.instance()

        val xAxis = chartBuilder.newNumericAxis().build()
        val yAxis = chartBuilder.newNumericAxis().build()

        val dataSeries = UniformHeatmapDataSeries<Int, Int, Int>(Int::class.javaObjectType, Int::class.javaObjectType, Int::class.javaObjectType, WIDTH, HEIGHT)
        for (x in 0 until WIDTH)
        {
            for (y in 0 until HEIGHT)
            {
                val value = when (x)
                {
                    0,
                    (0.25 * WIDTH).roundToInt(),
                    (0.5 * WIDTH).roundToInt(),
                    (0.75 * WIDTH).roundToInt() -> 50
                    else                        -> 0
                }
                dataSeries.updateZAt(x, y, value)
            }
        }

        val series = chartBuilder.newUniformHeatmap()
            .withColorMap(ColorMap(intArrayOf(ColorUtil.DarkBlue, ColorUtil.CornflowerBlue, ColorUtil.DarkGreen, ColorUtil.Chartreuse, ColorUtil.Yellow, ColorUtil.Red), floatArrayOf(0f, 0.2f, 0.4f, 0.6f, 0.8f, 1f)))
            .withDataSeries(dataSeries)
            .build()

        chartSurface.suspendUpdates().use {
            chartSurface.xAxes.add(xAxis)
            chartSurface.yAxes.add(yAxis)
            chartSurface.renderableSeries.add(series)
        }
    }
}
2 votes
11k views

Hi guys,

I’ve been trying to select data points in my heat map for the whole without success. I’ve read, re-read and re-re-read the documentation, but I can’t figure out what I’m doing wrong.

Here’s the XAML.

...

<s:SciChartSurface.RenderableSeries>
    <s:FastUniformHeatmapRenderableSeriesForMvvm
        x:Name="heatmapSeries" 
        Opacity="0.9" 
        DataSeries="{Binding UniformHeatmapDataSeries}"
        s:DataPointSelectionModifier.IncludeSeries="True" >

        <s:FastUniformHeatmapRenderableSeriesForMvvm.ColorMap>
            <s:HeatmapColorPalette Maximum="60" Minimum="6">
                <s:HeatmapColorPalette.GradientStops>
                    <GradientStop Offset="0" Color="Transparent"/>
                    <GradientStop Offset="0.1" Color="DarkBlue"/>
                    <GradientStop Offset="0.2" Color="CornflowerBlue"/>
                    <GradientStop Offset="0.4" Color="DarkGreen"/>
                    <GradientStop Offset="0.6" Color="Chartreuse"/>
                    <GradientStop Offset="0.8" Color="Yellow"/>
                    <GradientStop Offset="1" Color="Red"/>
                </s:HeatmapColorPalette.GradientStops>
            </s:HeatmapColorPalette>
        </s:FastUniformHeatmapRenderableSeriesForMvvm.ColorMap>

        <s:FastUniformHeatmapRenderableSeriesForMvvm.PointMarker>
            <s:XPointMarker Fill="Pink" Width="5" Height="5"/>
        </s:FastUniformHeatmapRenderableSeriesForMvvm.PointMarker>

        <s:FastUniformHeatmapRenderableSeriesForMvvm.SelectedPointMarker>
            <s:TrianglePointMarker Fill="White" Width="12" Height="12"/>
        </s:FastUniformHeatmapRenderableSeriesForMvvm.SelectedPointMarker>

    </s:FastUniformHeatmapRenderableSeriesForMvvm>

    ...

</s:SciChartSurface.RenderableSeries>
...

Here’s the MVVM code.

...
class SelectedPointMetadata : IPointMetadata
{
    public bool IsSelected { get; set; }

    public event PropertyChangedEventHandler PropertyChanged;
}
...

double[,] heatMap = new double[heatMapHeight + glowRadius * 2, heatMapWidth + glowRadius * 2];
double[,] glowMatrix = this.getGlowEffectMatrix(glowRadius);

SelectedPointMetadata[,] selectablePoints = new SelectedPointMetadata[heatMapHeight + glowRadius * 2, heatMapWidth + glowRadius * 2];

for (int i = 0; i < spectrogram.SpectrogramAtoms.Count; i++) {
    var atom = spectrogram.SpectrogramAtoms[i];
    int x = Math.Min((int)(atom.Frequency.Hertz / frequencyStep) + glowRadius, heatMapHeight - 1);
    int y = Math.Min((int)(atom.Time.Seconds / xStep) + glowRadius, heatMapWidth - 1);
    this.applyEffectMatrix(x, y, atom.SNR, ref heatMap, ref glowMatrix, glowRadius);

}

var xBound = heatMap.GetLength(0);
var yBound = heatMap.GetLength(1);

Random rnd = new Random();

for (var i = 0; i < xBound; i++)
{
    for (var j = 0; j < yBound; j++)
    {
        var x = rnd.Next(1, 10);

        selectablePoints[i, j] = new SelectedPointMetadata() { IsSelected = false };

        if (x == 5)
        {
            selectablePoints[i, j].IsSelected = true;
        }

    }
}

this.UniformHeatmapDataSeries = new UniformHeatmapDataSeries<double, double, double>(
    heatMap,
    (-xStep * glowRadius),
    xStep,
    (-frequencyStep * glowRadius),
    frequencyStep,
    selectablePoints
    );

...

What am I missing?

0 votes
9k views

Hi there:

I am developing an application where the main chart is a heat map type one. I would like to have a custom cursor modifier to show some values of the x, y and z axes with limit digits. The problem is that so far I get these result:

Capture
EDIT: PLEASE INSERT AN IMAGE HERE

I would like to show only 1 decimal in the Z axis and 0 decimals en the X and Y axis. I have checked your modifiers demo but it seems to be not working for my heatmap chart. Any kind of advice about this issue would help me to have the application I am looking for.

The XAML of my chart is like this:

 <s:SciChartSurface x:Name="sciChart" Grid.Column="1" Grid.Row="3" Padding="0" BorderThickness="0" MouseDown="SciChart_MouseDown" Margin="0">
            <s:SciChartSurface.RenderableSeries>
                <s:FastUniformHeatmapRenderableSeries x:Name="heatmapSeries" 
                                                      Opacity="0.9"/>
            </s:SciChartSurface.RenderableSeries>

            <s:SciChartSurface.XAxis>
                <s:NumericAxis DrawMajorBands="True"  
                               DrawLabels="False"
                               TextFormatting="0N"
                               GrowBy="0, 1"
                               s:RolloverModifier.AxisLabelContainerStyle="{StaticResource AxisLabelStyle}" 
                               s:RolloverModifier.AxisLabelTemplate="{StaticResource AxisLabelTemplate}" 
                               s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorAxisLabelStyle}"/>
            </s:SciChartSurface.XAxis>

            <s:SciChartSurface.YAxis>
                <s:NumericAxis DrawMajorBands="True" 
                               GrowBy="0, 1"
                               DrawLabels="False" 
                               VisibleRange="0,249"  
                               TextFormatting="0"/>
            </s:SciChartSurface.YAxis>

            <s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:RolloverModifier x:Name="RolloverModifier"
                                    IsEnabled="True"
                                    ShowTooltipOn="Always" />
                    <!--<s:CursorModifier IsEnabled="True" ShowTooltip="True" ShowTooltipOn="MouseOver"
                        ShowAxisLabels="true" SourceMode="AllSeries"/>-->
                    <s:CursorModifier x:Name="CursorModifier"
                                  IsEnabled="False"
                                  UseInterpolation="False"
                                  ShowAxisLabels="False"
                                  ShowTooltip="True"
                                  ShowTooltipOn="MouseOver"/>
                    <!--<s:VerticalSliceModifier IsEnabled="True">
                        <s:VerticalSliceModifier.VerticalLines>
                            <s:VerticalLineAnnotation IsEditable="false"
                                                  LabelPlacement="Axis"
                                                  ShowLabel="true"
                                                  LabelTextFormatting="0"/>
                        </s:VerticalSliceModifier.VerticalLines>
                    </s:VerticalSliceModifier>-->
                </s:ModifierGroup>

            </s:SciChartSurface.ChartModifier>
        </s:SciChartSurface>

Thanks in advanced.

0 votes
4k views

To avoid arrays in LOH the UniformHeatmapDataSeries should use IList[] or Span instead of TZ[,].

  • Tobias asked 5 years ago
  • last active 5 years ago
0 votes
0 answers
4k views

An empty chart is displayed if a custom axis id is configured for Heatmap series. Only “DefaultAxisId” seems to be supported.
Please suppport custom axis id with Heatmap series (with MVVM) to achieve the same behavior as other series types.

0 votes
4k views

I’m trying to add more intervals into the legend of the Heat map. So far it only displays 10, 8, 6, 4, 2, 0, but I would like to edit it to display the numbers 0-10. From what I understand, the TickProvider API only works with an X or Y axis so I’m not sure if there’s a way to add the function.

0 votes
4k views

I was looking at the example given at this link for NonUniformHeatmapDataSeries in SciChart. In this example, the width and height of heatmap is given as h=4 and w=7. As I understand h is for Y axis and w is for X axis and data[,] is for Z axis. However, the counts in actual data filled for these axis are not matching wight h and w.

var xRangeMapping = new int[] { 0, 10, 20, 26, 36, 60, 72, 84 };   // 8 points for w
var yRangeMapping = new int[] { 100, 250, 390, 410, 600 };         // 5 points for h

What is the purpose of extra points added at first place (0 and 100)? Are these required to set the starting point for both axis?

Here is the code given at above link:

int w = 7, h = 4;
var data = new double[h, w];
double maxValue = double.MinValue;
for (int x = 0; x < w; x++)
    for (int y = 0; y < h; y++)
    {
        data[y, x] = 3.5 * ((h - y) * (w - x));
        maxValue = Math.Max(maxValue, data[y,x]);
    }
var xRangeMapping = new int[] { 0, 10, 20, 26, 36, 60, 72, 84 };
var yRangeMapping = new int[] { 100, 250, 390, 410, 600 };
var heatmapDataSeries = NonUniformHeatmapDataSeries<int, int, double>(data, i => xRangeMapping[i], i => yRangeMapping[i]);

// Apply the Heatmap DataSeries to a FastNonUniformheatmapRenderableSeries
var heatmapRenderableSeries = new FastUniformHeatmapRenderableSeries()
 {      
     ColorMap = new HeatmapColorPalette()
    {
        Maximum = maxValue,
        Minimum = 0,
        GradientStops = // exercise left to the reader
    }
 };
  • Anil Soman asked 5 years ago
  • last active 5 years ago
0 votes
4k views

Hello,

I had previously commented on an existing issue, but wanted to bump here since it’s impeding development.

When adding a DataPointSelectionModifier to a chart surface containing a FastUniformHeatmapRenderableSeries with a UniformHeatmapDataSeries, an exception is thrown on a mouse drag.

The modifier is added simply with:

<s:SciChartSurface.ChartModifier>
    <s:ModifierGroup>
        <s:DataPointSelectionModifier/>
    </s:ModifierGroup>
</s:SciChartSurface.ChartModifier>

After adding this modifier and using my mouse to select a part of the heatmap, I get the following System.InvalidOperationException (stack trace below):

"Metadata for his type cannot be returned as an one-dimentional array. Please use the IPointMetadata[,] Metadata property"

I’m assuming this is happening because DataPointSelectionModifier was by default not meant for data series with 2D arrays, but I’m not sure how to follow the exception message “Please use the IPointMetadata[,] Metadata property”.

Ultimately I am trying to run a calculation on the selected subset of the heatmap. Any help would be appreciated and thanks in advance!

Stack trace:

  at SciChart.Charting.Model.DataSeries.Heatmap2DArrayDataSeries.BaseHeatmapDataSeries`3.SciChart.Charting.Model.DataSeries.IDataSeries.get_Metadata()
   at SciChart.Charting.ChartModifiers.DataPointSelectionModifier.UpdateState()
   at SciChart.Charting.ChartModifiers.DataPointSelectionModifier.KUB()
   at A.MEB.D[D](D D, Boolean I, Func`1 J)
   at SciChart.Charting.ChartModifiers.DataPointSelectionModifier.get_SelectedPointMarkers()
   at SciChart.Charting.ChartModifiers.DataPointSelectionModifier.DeselectAllPointMarkers()
   at SciChart.Charting.ChartModifiers.DataPointSelectionModifier.SelectManyPoints(Point startPoint, Point endPoint, SelectionMode selectionMode)
   at SciChart.Charting.ChartModifiers.DataPointSelectionModifier.OnModifierMouseUp(ModifierMouseArgs e)
   at SciChart.Charting.ChartModifiers.ModifierGroup.FTB(Action`2 D, ModifierEventArgsBase I)
   at SciChart.Core.Extensions.EnumerableExtensions.ForEachDo[T](IEnumerable`1 enumerable, Action`1 operation)
   at SciChart.Core.Utility.Mouse.MouseManager.GB(IPublishMouseEvents D, IReceiveMouseEvents I, MouseEventArgs J, MouseButtons M, Action`3 O)
   at SciChart.Core.Utility.Mouse.MouseManager.AEB.S(Object D, MouseButtonEventArgs I)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at Main.main(String[] _arg1) in ...\App.fs:line 13
  • jsacks asked 5 years ago
  • last active 5 years ago
0 votes
9k views

Hello!

I am trying to programmatically set a range for HeatmapColorPalette and attached HeatmapColorMap to min and max of my data.

Binding HeatmapColorPalette.Maximum to a property in my View Model works well. However, when I add HeatmapColorMap everything breaks, the heat map no longer responds to changes in View Model.

What am I doing wrong?

Here is my View:

<Window x:Class="SciChartHeatMap.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:SciChartHeatMap"
    xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
    d:DataContext="{d:DesignInstance Type=local:HeatMapViewModel, IsDesignTimeCreatable=True}"
    mc:Ignorable="d"
    Title="MainWindow" Height="450" Width="800">
<Grid>
    <Grid.Resources>
        <s:GradientStopsToLinearGradientBrushConverter x:Key="ColorsToLinearGradientBrushConverter"/>
    </Grid.Resources>
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition/>
    </Grid.RowDefinitions>
    <s:SciChartSurface Grid.Row="0" Grid.RowSpan="2">
        <s:SciChartSurface.RenderableSeries>
        <s:FastUniformHeatmapRenderableSeries x:Name="HeatMapSeries" DataSeries="{Binding Data}" Opacity="0.9">
            <s:FastUniformHeatmapRenderableSeries.ColorMap>
                <s:HeatmapColorPalette Maximum="{Binding ColorMaximum}">
                    <s:HeatmapColorPalette.GradientStops>
                        <GradientStop Offset="0" Color="DarkBlue"/>
                        <GradientStop Offset="0.2" Color="CornflowerBlue"/>
                        <GradientStop Offset="0.4" Color="DarkGreen"/>
                        <GradientStop Offset="0.6" Color="Chartreuse"/>
                        <GradientStop Offset="0.8" Color="Yellow"/>
                        <GradientStop Offset="1" Color="Red"/>
                    </s:HeatmapColorPalette.GradientStops>
                </s:HeatmapColorPalette>
            </s:FastUniformHeatmapRenderableSeries.ColorMap>
        </s:FastUniformHeatmapRenderableSeries>
        </s:SciChartSurface.RenderableSeries>
        <s:SciChartSurface.XAxis>
            <s:NumericAxis 
                FlipCoordinates="False" 
                ScientificNotation="None" 
                AutoTicks="False"
                MajorDelta="1"
                MinorDelta="0.5"
                AxisAlignment="Top"/>
        </s:SciChartSurface.XAxis>
        <s:SciChartSurface.YAxis>
            <s:NumericAxis 
                FlipCoordinates="True" 
                ScientificNotation="None"
                AxisAlignment="Left"/>
        </s:SciChartSurface.YAxis>
    </s:SciChartSurface>

    <!-- Enabling this will break the program
    <s:HeatmapColorMap
        Grid.Column="1"
        Grid.Row="0"
        Grid.RowSpan="2"
        Margin="5,0,5,0"
        HorizontalAlignment="Right"
        VerticalAlignment="Stretch"
        DataContext="{Binding Source={x:Reference Name=HeatMapSeries}, Mode=OneWay}"
        ColorMap="{Binding ColorMap.GradientStops, Converter={StaticResource ColorsToLinearGradientBrushConverter}}"
        Maximum="{Binding ColorMap.Maximum}"
        Orientation="Vertical">
    </s:HeatmapColorMap>
    -->

    <Label 
        Grid.Row="0" 
        Grid.Column="2" 
        Content="{Binding ColorMaximum}" 
        Width="50" 
        HorizontalContentAlignment="Center"/>
    <Slider 
        Grid.Column="2" 
        Grid.Row="1" 
        Orientation="Vertical" 
        Minimum="0" 
        Maximum="10" 
        HorizontalAlignment="Center"
        Value="{Binding ColorMaximum}"/>
</Grid>

The idea in this small example is for slider to control both HeatmapColorPalette.Maximum and s:HeatmapColorMap.Maximum

The code in my View Model is pretty simple:

private double mColorMax;

public double ColorMaximum
    {
        get => mColorMax;

        set
        {
            mColorMax = value;
            OnPropertyChanged();
        }
    }

My View Model implements INotifyPropertyChanged

I will appreciate any suggestions.

Thank you in advance!

0 votes
6k views

Hello!

I am trying to render a HeatMap and align labels next to squares (see the attached image). However, I am running into two issues.

Firstly, I am using RenderTransform to shift labels so that they are aligned with the squares instead of being on the borders between them. It works, but does not look good as I resize the control.

Second, the axes render the last label outside the view. I tried setting VisualRange and VisualRangeLimit but it did not help. It hides the last data column (or row) and still displays the last label.

Any suggestions on how I can solve it?

I am attaching a sample project.

Thank you in advance!

0 votes
5k views

I would like to add labels to contour lines as shown in this previous post.

https://www.scichart.com/questions/wpf/is-it-possible-to-do-contour-plots

I have created the heat map with contours, and now I want to programmatically add labels. To this end. I have created a contour series in my view model

        var contourSeries = new FastUniformContourRenderableSeries
        {
            DataSeries = dataSeries,
            ZMin = 0.0,
            ZMax = 50.0,
            ZStep = 4.0
        };

This is the same series as I have already plotted. I have looked through this object, trying to find the plotted contour lines, so I can calculate positions to put labels, but I have not found the data. Can you tell me how to extract the plotted contour curve data?

0 votes
8k views

Hi,
I would like to draw a polygon over a heatMap using an inherited class of UniformHeatMapDataSeries.
An example using FastHeatMapRenderableSeries was described here : https://www.scichart.com/questions/wpf/drawing-a-polygon-upon-a-heatmap-chart ,but it is now deprecated since SciCharts V5.

Instead of that, i tried to declare an inherited class of CustomRenderableSeries as shown here :

public class PolygonRenderableSeries : CustomRenderableSeries {
protected override void Draw(IRenderContext2D renderContext, IRenderPassData renderPassData)
{
base.Draw(renderContext, renderPassData);
}
}

What i need now is to pass a List of Polygons to this class in order to draw them directly. I know how to draw a polygon, but i don’t know how to override the renderPassData for adding polygons to it.

Could you help me about that ?
Best regards,

0 votes
10k views

I have two questions on rollover modifier.

One is the tooltip of the rollover is right under the finger on a heatmap chart. Can I move it to the top left section of the touch point?

Second question is how can I implement a callback function whenever Y axis of the rollover modifier changes?

Thanks for your attention in advance.

  • Gang Xu asked 4 years ago
  • last active 4 years ago
0 votes
4k views

Hello, I’ve been trying to create a SCIUniformHeatMap, but I only get a blank, black screen.
Can anyone recommend why colors and the graph aren’t showing up? Thanks

var ecmSurface: SCIChartSurface = SCIChartSurface()
var ecmDataSeries = SCIUniformHeatmapDataSeries(xType: .double, yType: .double, zType: .double, xSize: ReviewModeData.MATRIX_COLUMNS, ySize:ReviewModeData.MATRIX_ROWS)
var heatmapRenderableSeries: SCIFastUniformHeatmapRenderableSeries = SCIFastUniformHeatmapRenderableSeries()
private let countColors = 6
private var colorRGBArray: [UIColor] = [
UIColor(red: 0.0/255.0, green: 0.0/255.0, blue: 131.0/255.0, alpha: 1),
UIColor(red: 0.0/255.0, green: 0.0/255.0, blue: 255.0/255.0, alpha: 1),
UIColor(red: 0.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1),
UIColor(red: 255.0/255.0, green: 255.0/255.0, blue: 0.0/255.0, alpha: 1),
UIColor(red: 255.0/255.0, green: 0.0/255.0, blue: 0.0/255.0, alpha: 1),
UIColor(red: 128.0/255.0, green: 0.0/255.0, blue: 0.0/255.0, alpha: 1)
]
for i in 0..<ReviewModeData.MATRIX_COLUMNS {
for j in 0 ..< ReviewModeData.MATRIX_ROWS {
ecmDataSeries.update(z: ecm2DMatrix[i][j], atX: i, y: j)
}
}
var colorZValueArray: [Double] = determineColorMapValues(clim1: 0, clim2: 1);
var colorMap = SCIColorMap(colors: colorRGBArray, andStops: colorZValueArray as [NSNumber])

//configure ECM heatmap
heatmapRenderableSeries.minimum = ReviewModeData.ECM_CLIM1
heatmapRenderableSeries.maximum = ReviewModeData.ECM_CLIM2
heatmapRenderableSeries.dataSeries = ecmDataSeries
heatmapRenderableSeries.colorMap = colorMap!

0 votes
4k views

Hi,

I tried to initialize heatmap chart with NaN to make it transparent, but it doesn’t work that way. The color was blue, which is zero in the colormap. Is there a way to make it not showing any color?

Thanks,

public void initECMSciChart() {
    // initialize chart with NaN
    for (int i = 0; i < MATRIX_COLUMNS; i++) {
        for (int j = 0; j < MATRIX_ROWS; j++) {
            heatmap2DMatrix[i][j] = 0;
            heatmapDataSeries.updateZAt(i, j, Double.NaN);
        }
    }
    heatmapDataSeries.setStartX(0d);
    heatmapSurface.zoomExtentsX();
}
  • Gang Xu asked 4 years ago
  • last active 4 years ago
0 votes
6k views

Hi,

I tried to implement a colormap view next to the heatmap chart. But couldn’t figure out how to set it up. It seems like it won’t work this way.

SciChartHeatmapColourMap colorMapView = new SciChartHeatmapColourMap(this);
colorMapView.findViewById(R.id.colorMapView);

I don’t know how Bindview works in the example code. Could you tell me how to link SciChartHeatmapColourMap to the view in layout xml?

Thanks.

  • Gang Xu asked 4 years ago
  • last active 4 years ago
0 votes
4k views

Hi SciChart-Team,

I’m currently rewrite one of our applications and move this from the leagacy .NET Framework to .NET Core.
I also replace the old SciChart.DirectX package and the DirectX Renderer plugin with the new VisualXcceleratorEngine witch is also based on DirectX.

In one chart we display a Order Spectrum as a heatmap (FastUniformHeatmapRenderableSeries) with linearly interpolated color between the cells. Thefore we activate the property UseLinearTextureFiltering.

But with the new VisualXcceleratorEngine is there no linearly interpolated color between the cells. Is this feature only available for the old DirectX Renderer plugin??

Thanks

0 votes
3k views

I am using UniformHeatMapDataSeries to plot a heat map in WPF/C#. However, the data is very large in size and as a result it is throwing OutOfMemoryException while populating the first parameter value of this data series. which is a two dimensional array TZ (generic).

As per definition:

public UniformHeatmapDataSeries(TZ[,] zValues, TX xStart, TX xStep, TY yStart, TY yStep, IPointMetadata[,] metadata = null);

Here I am filling this array with double[,] data.

This error is happening due to TZ double[,] is filled with very big size of data going out of max defined range of double 2D array size. Please suggest if I can replace the values of double[,] with any other data type which allow larger data.

  • Anil Soman asked 3 years ago
  • last active 3 years ago
0 votes
3k views

Hi,

Is it possible to specify that incoming zValues array matrix is an array of columns, instead of an array of rows?

e.g. if I pass this:

[
[1,2,3],
[4,5,6],
[7,8,9]
]

[1,2,3] is the first column, not the first row.

We want to avoid transposing this data manually before passing it to the heatmap, because our data arrives one column at a time via a websocket subscription, and the data is too large to efficiently re-transpose every time.

I can’t see anything in the docs or the code?

Thanks
Joe

0 votes
4k views

Hi, I noticed that Heattexture: [object Object] is logged hundreds/thousands of times while interacting with a heatmap. This isn’t my console log, as it is a very simple implementation and there are no logs on my front end, with nothing called Heattexture in my repository.

I’m guessing that this is a leftover console log that needs to be removed, as it occurs in both my development and production Webpack builds.

Most of the time it does not cause any performance issues, but once I did see the heatmap flickering at roughly the same rate of the console log.

Screenshot attached.

Thanks!

0 votes
7k views

Hi , many of the charts provide a way to set the date on the x axis for the data series and that makes the axis match the DataSeries value defined for that axis, but for heatmap dataseries when you define xType as date the xAxis of type date is not displaying on surface, I don’t know what I’m doing wrong and there is no sample for dates on GitHub , the samples only use int , would be great if you can provide a date sample for the heatmap , thanks

Showing 1 - 50 of 70 results

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies