Welcome Guest Search | Active Topics |

Displaying Invalid Data Points
Voltegirev
#1 Posted : Wednesday, August 2, 2017 8:22:00 AM(UTC)
Rank: Newbie

Groups: jQueryDV, Registered
Joined: 6/8/2017(UTC)
Posts: 9

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Hi,

is there a way to mark data points (bar specifically) on a chart which are not valid.
I mean if we have a set of values for a given timestamps and some of the values are untrusted (bad quality) we want to mark them.

As I see it there should be some kind of boolean value for each of data point in the array, something like:
{
type: 'column',
data: [['A', 33, true], ['B', 57, true], ['C', 33, false],
['D', 12, true], ['E', 35, true], ['F', 7, true], ['G', 24, true]],
fillStyle: 'green',
strokeStyle: 'black',
lineWidth: 2
}
So we have C = 33 value as invalid data point. We want it to be displayed specifically on a chart. And I believe we need to be able to override visual effects for such data points.


Or maybe there is other methods to accomplish such a thing?
Dragan
#2 Posted : Thursday, August 3, 2017 5:41:44 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
Hi,

You can use "shapeRendering" event to customize the chart:
http://www.jqchart.com/jquery/chart/CustomizingChart/ShapeRenderingEvent

In your case the code can be something like:
Code:
$(document).ready(function () {

            $('#jqChart').bind('shapeRendering', function (e, shape) {

                if (shape.context.dataItem[2] === false) {
                    shape.strokeStyle = 'red';
                    shape.lineWidth = 3;
                }
            });

            $('#jqChart').jqChart({
                title: 'shapeRendering Event',
                series: [
                    {
                        type: 'column',
                        data: [['A', 33, true], ['B', 57, true], ['C', 33, false],
                            ['D', 12, false], ['E', 35, true], ['F', 7, true], ['G', 24, true]],
                        fillStyle: 'green',
                        strokeStyle: 'black',
                        lineWidth: 2
                    }
                ]
            });
        });

Best Regards,
Dragan Matek
jqChart Inc.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.077 seconds.