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

0 votes
3k views

Error from chart in div chart1 Error: getNativeXValues is invalid for heatmap type series. Try getting or setting zValues instead
at UniformHeatmapDataSeries.BaseHeatmapDataSeries.getNativeXValues (BaseHeatmapDataSeries.js:430:1)

Help! Please!

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
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 7 years ago
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
1 vote
3k views

I am trying to add an axis annotation to a heatmap legend. When this annotation is dragged, the color mapping of the heatmap series and the heatmap legend will be changed. How can I modify the colorMap.gradientStops of the heatmap series and the heatmap legend while the chart is running?

  • Quyen Sy asked 1 year ago
  • last active 1 year ago
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
8k 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

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
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
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!

1 vote
3k views

I am implementing a heatmap. The data size of the heatmap would be changed. I update the UniformHeatmapDataSeries with the updated zValues according to this post.

https://www.scichart.com/questions/js/failed-to-update-the-zvalues-size-of-uniformheatmapdataseries-in-heatmap

There is no problem if I update the UniformHeatmapDataSeries with a larger size zValues array. However, when I update it with a smaller size zValues array, the heatmap width will be decrease (Please refer to my screenshots). How can I keep the heatmap always 100% width?

  • Quyen Sy asked 12 months ago
  • last active 12 months ago
1 vote
3k views

Dear Andrew,

Thank you for the past answers. I have a new question. I have a heatmap with 2 line charts at its left aand top position. the top line chart plot the horizontal values where the mouse if hovering and left chart displays vertical values from the mouse position.

This is working great, but the issue is the heatmap is not always square and I am trying the aligh the line charts with the heatmap dimensions

two issues,

  1. the heatmap X/Y dimension are not always same, in fact I have a function which listens to the changing heatmap zoom factor and makes sure the X/Y are always “square” as we want to show the heatmap with square pixels. (see video #2) https://youtu.be/wXStF-7bWsw

  2. As I dynamically chage the size of the plot the… the proportion of actual chart area to axis lable changes thus varying the overlap. (see video #1) https://youtu.be/loAVpYSRJ38

Let me know if you need more information,

Best,

Pramod

0 votes
3k views

Is it possible to change the heatmap legend from vertical to horizontal?

  • Quyen Sy asked 11 months ago
  • last active 11 months ago
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
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
5k 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.

1 vote
2k views

Hi Andrew,

I have 2 independent questions,

Q1.
I have been working with uniform heatmap and I need a way to fix the aspect ratio to 1, for all resize, zoom events, is there an option in heatmap to fix an aspect ration? Please see the attached video
https://youtu.be/obhH6KLExYw

Q2.
I am trying to implement a lasso select method to select and highlight the heatmap data. I did not find lasso select in the documentation hence I went ahead and implemented my own method.

I am drawing an svg using D3 (offsetX and offsetY variables) and then adding it to the annotation as you will see in the video and trying to get all the hitTest data inside the lasso.

If I use the customAnnotation then heatmap is able to draw correct size and location of the SVG
customAnnotation:
https://youtu.be/gL34sAbxYSE

But it does not pan and zoom with the plot data. after looking through documentation I came across OverviewCustomResizableAnnotation which seems designed for zooming and panning with the data.

But while using the OverviewCustomResizableAnnotation the SVG size keeps changing during the update and is not located at the correct location relative to the data.

sciChartSurfaceRef.current.annotations.add(
new OverviewCustomResizableAnnotation({
id: "lassoSVG",
x1: shortestXinData,
y1: shortestYinData,
isEditable: false,
isSelected: false,
yCoordinateMode: ECoordinateMode.DataValue,
xCoordinateMode: ECoordinateMode.DataValue,
verticalAnchorPoint: EVerticalAnchorPoint.Top,
horizontalAnchorPoint: EHorizontalAnchorPoint.Left,
svgString: new XMLSerializer().serializeToString(svg.node())
})
)

OverviewCustomResizableAnnotation:
https://youtu.be/-AOJ9V3l-xI

Thanks,

Pramod

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

Showing 51 - 70 of 70 results

Try SciChart Today

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

Start TrialCase Studies