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

0 votes
714 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)
        }
    }
}
1 vote
2k 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
2k views

Hello,

I’m using FastHeatMapRenderableSeries in my project. I need to display this HeatMap on vetrical charts. But when I make AxisAlignment=”Right” for x-axis and AxisAlignment=”Bottom” for y-axis, the HeatMap disappears.
How can I fix this?

I’ve attached an example project below

Thanks in advance

1 vote
2k views

To whom this may concern:

I am having an issue setting the axis alignment with your 2D Heatmap series. I have tested this with your “Heatmap Chart” sample from your Examples Suite.

Lines 44-50 are shown below from your “HeatMapExampleView” XAML file. I have added the AxisAlignment parameters as shown.

<s:SciChartSurface.XAxis>
    <s:NumericAxis AxisAlignment="Left" DrawMajorBands="True" />
</s:SciChartSurface.XAxis>

<s:SciChartSurface.YAxis>
    <s:NumericAxis AxisAlignment="Top" DrawMajorBands="True" />
</s:SciChartSurface.YAxis>

Note how the Y-Axis is aligned to a vertical parameter (Top, in this case) and X-Axis is aligned to a horizontal parameter (Left). This leads to scichart not showing any heatmap at all, as shown in the attached images.

It will work if i set Y to Left or Right, and X to Top or Bottom, but not the other way around.

Can you please advise?

Thanks kindly!

  • Ari Sagiv asked 3 years ago
  • last active 3 years ago
0 votes
2k views

Hello,

I have a heatmap that I pass two mapping functions to the Heatmap2DArrayDataSeries (one for x indices and one for y indices).

That is working great.

The user can set the amount of intervals they want to see (as major gridlines). So what I want is to manually control the MajorDelta and MinorDelta, and also set the AutoTicks=false.

When I do this, it renders all the frame for the SciChart Surface, but it seems that it starts making calculations and never draws the heatmap not the gridlines, and finally it throws an OutOfMemory exception.

My data set is not that large: 60×112

What alternative do I have for controlling the amount of intervals shown?

Thank you.
Sebastian

0 votes
2k 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

0 votes
2k 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 3 years ago
  • last active 3 years ago
0 votes
0 answers
2k 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
5k views

FAQ: How to create a custom legend with TextFormatting for the FastHeatmapRenderableSeries? The provided legend in SciChart v3.4 does not allow text formatting.

  • Andrew asked 4 years ago
  • last active 4 years ago
1 vote
5k views

Hi,

I have 3 questions regarding the FastHeatMapRenderableSeries

First, I would like to ask whether it possible to use the transparent color FastHeatMapRenderableSeries, even when the map itseft is opaque (Opacity=1)? I tried to include the transparent color into the ColorMap gradient brush, but then the corresponding data values are shown in white.

Second, when the heatmap is scaled, the semi-transparent cell borders are visible on the heatmap. Can I get rid of them, for example, with the UseLayoutRounding or proper scaling?

Finally, if I continuously refresh the heatmap with incoming data, I see some rendering artifacts in some frames. The artifacts are usually black vertical stripes or, more rarely, rectangles. Can it be related to graphics hardware?

I made a screenshot demonstrating all 3 problems and attached it here.

Thank you very much in advance!

Ilia

  • corvex asked 4 years ago
  • last active 4 years ago
Showing 10 results
This template supports the sidebar's widgets. Add one or use Full Width layout.