oxyplot / oxyplot

A cross-platform plotting library for .NET
https://oxyplot.github.io/
MIT License
3.3k stars 963 forks source link

HeatMaps can't be rendered with single column/row data #129

Open objorke opened 10 years ago

objorke commented 10 years ago

Imported from http://oxyplot.codeplex.com/workitem/10180

JulianRendell 2014-04-17 00:26 It's easy to reproduce:

Edit C:\dev\oxyplot_af2ed795a9fe\Source\Examples\ExampleLibrary\Examples\HeatMapSeriesExamples.cs

Modify CreateExample and change-

        var data = new double[2, 3];
        data[0, 0] = 0;
        data[0, 1] = 0.2;
        data[0, 2] = 0.4;
        data[1, 0] = 0.1;
        data[1, 1] = 0.3;
        data[1, 2] = 0.2;

to either:

        var data = new double[1, 3];
        data[0, 0] = 0;
        data[0, 1] = 0.2;
        data[0, 2] = 0.4;

or:

        var data = new double[2, 1];
        data[0, 0] = 0;
        data[1, 0] = 0.1;

recompile, and run the winform example browser and select the heatmap examples.

There's a divide by 0 exception triggered.

VisualMelon commented 8 years ago

I think the issue is that HeatMaps, by their nature, are no good at this job - it isn't meaningful to have a 1column/row heatmap, though the exception could be more useful.

pentarex commented 8 years ago

bce working In case we have this kind of chart which is with multiple Axes (we are trying to achieve something like excel is doing when you have bar chart) and we have only one column the whole screen goes white... I don't know exactly how it can be fixed :( and if I export the plot to a picture you can still the chart but without the data underneath :8ball: