Blog

Visiblox Charts 3.0 – Grab it while it’s hot!

Hello Visiblox friends,

Today is an exciting day - we're announcing the release of Visiblox Charts 3.0!  We've been working away at this release for 5 months and there's some pretty cool stuff packed into it.  So without further ado, let's take a quick tour of what's new.

New Behaviour API

We really went to town on behaviours this time, guys.  Ever since our very first release Visiblox Charts has been highly interactive, it has had dynamic zooming, panning, trackballs and more, all provided via our extensible Behaviour API.  But, in this release, we've put that API on steroids and added a super charger!

Now Behaviours can support all the mouse buttons, mouse wheel, keyboard events, gestures, keyboard modifiers.  Not only that, but events can be triggered by mouse interactions on axes as well as the plot area.

Want to let users zoom with the left mouse button and pan with the right?  Go for it.  Want to zoom on the plot area and use drag events on the axes to pan?  No problem.  How about activating the ruler behaviour when the shift key is pressed?  Yup.  Pan with the arrow keys as well as mouse? Done.

Per-Point Styling

 

PerPointStyling

One request we've had many times from customers is the ability to style individual points differently from the rest.  Well, your wish is our command, as they say!  With our new PointRendered event, you can take full control of the styling on a point by point basis.  This will let you colour all your bars over 100 blue, or have every 7th point have a semi-translucent gradient fill.

Heat Plots (Ultimate Edition only)

As I mentioned in my preview post a few weeks back, we have been working on heat plots for Visiblox Charts - well guess what?  They made it.  We support two different kinds of heat plots - discrete and standard.  A heat plot is effectively a type of scatter chart where the colour of each point is based on a third dimension of data.  Not only that but overlapping points combine together, so you can easily spot clusters of high density data.  The discrete version of heat plots basically allows for the same concept but where each point occupies the full space available to it so you end up with a "grid" of data where each cell is coloured according to the amplitude of the data point in it.

Contour Plots (Ultimate Edition only)

Yes - they have made it in too!  Contour plots are series where the amplitude of a data point is rendered by displaying contour lines up to the data points value.  These are commonly used to render elevation on a topological map, or pressure zones in a weather chart.  The spacing of the contour lines is automatically calculated for you, and optionally can change as you zoom in and out of the chart to reveal more detail.

Donut Charts

DonutChart

We've added the ability to render donut (or ring) charts.  There is now an option on pie charts to cut out a hole in the middle of the pie, of a configurable size.  Set a simple property and turn your pies into donuts.  Easy as … well … pie (or donuts?).

Performance

As with every release we do, we gave performance some TLC.  This time around the memory usage of the raster series got a big going over.  We're aware that with large numbers of series the raster series can get a bit out of hand with 2.3 -  well 3.0 massively improves this, reducing memory usage by up to a factor of 15!  That's not all we did though, column and bar series got a big performance boost and raster series now do some internal filtering and pruning to significantly improve performance, especially for disconnected series types like candlesticks.

Clearly, there were minor improvements too many to mention here, all over the charts.  See below for a full change log of our API changes.

How do I get it?

If you're an existing Visiblox Charts customer and you have a valid support license, just drop us a line and we'll send you your free upgrade.  If not, why not take a trial of this new version and see for yourself.  Happy charting all!

Change Log

Annotations

  • VerticalLineWithValueAnnotation
    • Added XAxisLabel property
  • HorizontalLineWithValueAnnotation
    • Added YAxisLabel property

Axes & Ranges

  • LabelProperties
    • Added ShowLabels property
  • TickProperties
    • Added ShowMajorTicks and ShowMinorTicks properties
  • IRadialAxis
    • Renamed CenterAreaDiameter and CenterPoint
  • RadialLabelPosition
    • Renamed Center
  • AxisLabel
    • Added AllowAutoHide property
  • New IRangeProvider interface
  • New ILogicalAxis interface
  • New AxisTickIntervalHelper class
  • AxisBase
    • NumberOfTicks made virtual
    • GrowActualRange public method added
  • AutoScaleToVisibleDataCalculator
    • ScaleRangeToVisibleData signature changed
    • Added new 3 argument constructor
    • Added ZRangesToLimitBy property
  • New AxisDirection enum
  • DataPointComparison
    • Added CompareByZ method
    • Added CompareByXThenYThenZ method
  • Added ColorAxis class
  • Added LogicalIntervalAxis class
  • Added ILogicalAxis<T> interface

Behaviours

  • IBehaviour rewritten
  • New IEventSourceCondition interface and concrete implementations
  • New IBehaviourActivator interface and concrete implementations
  • New IEventContext interface and concrete implementations
  • Chart and AxisBase implement IEventSourceCondition
  • New AxisSubset enum
  • New BehaviourEventRouter class
  • New TouchBehaviour class (WPF4 only)
  • ZoomBehaviour
    • Added RelativeAxesToZoom dependency property
    • Added protected ResetZoom method
    • Added protected virtual CanZoomTo methods
  • PanBehaviour
    • Added DownKey, UpKey, LeftKey, RightKey, SmallStep, LargeStep and RelativeAxesToPan dependency properties
    • Added AxesToPan protected method
    • Added AllowPan protected method
  • Removed ZoomAndPanGestureBehaviour (WP7 only - all behaviours are now supported on WP7)
  • RulerBehaviour
    • Added StartMeasuring and StopMeasuring methods
  • New ProxyBehaviour class
  • RulerRectangle
    • Added protected methods SubscribeToDragHandleEvents, StartDraggingBottom, StartDraggingLeft, StartDraggingRight and StartDraggingTop
  • TrackballBehaviour
    • Renamed HideTrackballOnMouseLeave to HideTrackballOnPointerLeave

Chart

  • PieChart
    • Added PiePieceFillRatio dependency property
    • Added protected virtual AddToolTip method
  • RadialChart
    • Renamed CenterAreaDiameter
  • ChartBase
    • Removed DisableContextMenu
  • Chart
    • BehaviourContainer template part renamed to BehaviourCanvas

Data

  • New IDataPoint3D interface
  • New IDataSeries3D interface
  • New DataPoint3D class
  • New DataSeries3D class

Series

  • RasterChartSeriesBase 
    • Changed method signatures for DrawPoint, FinaliseDrawing
    • Added SkipPoint method
    • Added IsConnectedSeries property
    • Reviewed all methods to use an IHitTester rather than hit location arrays
    • Removed BuildBitmap method
    • Added GetImage method
    • Added CreateRange method
    • Added ResetRangeInternal method
  • RasterChartSeriesCommonBase
    • Removed default colours
    • Added HitTestingStrategy dependency property
    • Added HitTesterManager dependency property
    • Added BitmapManager dependency property
    • Added ZoomPending dependency property
    • Renamed AxisRelayAxisEventInternal to OnAxisRelayEvent
    • Made UpdateDataSeriesWithRanges non-virtual
    • Added EnablePerPointHitTesting property
    • Added EnableGeneralHitTesting property
    • Made AreKeyPropertiesNull method virtual
    • Now implements ISelectable
    • Added OnSelectionChangedInternal, OnSelectionModeChangedInternal, OnHighlightingEnabledPropertyChangedInternal, OnIsHighlightedPropertyChangedInternal and OnIsSelectedPropertyChangedInternal methods
  • Renamed RenderPositions to RenderPositionPoint
  • RasterLineSeries
    • New properties CachedShowLine, CachedShowPoints and CachedShowArea
    • New method ConvertRenderPointsToAreaPolygon
    • New method ConvertRenderSegmentToAreaPolygon
    • New property IsSortedLineSeries
    • Added AreaBaseAxis dependency property
    • Added AreaBaseValue dependency property
  • ChartSeriesCommonBase
    • Added abstract XRange and YRange properties
    • Added protected virtual AddToolTip method
  • Added interface IPointRenderingSeries
  • BandSeries
    • Added protected BuildLineGeometries and BuildAreaGeometry methods
  • New PathGeometryWithInverstion class
  • New BandGeometries class
  • CandlestickSeries
    • Added PointRendered event
  • LineSeries
    • Added PointRendered event
  • BarOrColumnSeries
    • Added PointRendered event
  • ErrorBarSeries
    • Added PointRendered event
  • BoxPlotSeries
    • Added PointRendered event
  • RadialLineSeries
    • Added PointRendered event
  • HlocSeries
    • Added PointRendered event
  • MultiValueSeriesBase
    • Added PointDrawn method
  • New RasterBandSeries and RasterBandSeriesStyle
  • New RasterDiscontinuousLineSeries
  • New RasterDrawingHelpers class
  • New StaircaseBandSeries
  • AutoSeriesGenerator
    • msSource method
  • New IChartSeries<T, T2> interface
  • New IChartSeries3D interface
  • New IContourRender interface
  • New RasterContourSeries class
  • DiscreteHeatPlotSeries
  • HeatPlotSeries,
  • RasterHeatPlotSeriesBase
  • ContourSeriesStyle
  • DiscreteHeatPlotSeriesStyle
  • HeatPlotSeriesStyle
  • New BlendMode enum
  • New DefaultColorMap class
  • New IColorMap interface
  • Renamed IChartSeriesWithDataLabels to IDataLabelAware
    • Renamed LabelRenderingEnabled property to ShowDataLabels
  • Renamed ISelectableChartSeries to ISelectable
  • Added IStyleProvider interface
    • Implemented by RasterLineSeries, RasterBarOrColumnSeriesBase and RasterContourSeries

 Miscellaneous

  • PointSnapper
    • FindClosestPointOnXorY signature has changed and now operates in render space
  • New AreaStyleContainer class
  • New IHitTester interface and concrete implementation
  • New HitTesterType enum
  • SortedList
    • Added RemoveDuplicates method
    • Added constructor which takes a capacity parameter
  • New BitmapManager class
  • WriteableBitmapAdapter
    • Added Clear extension method
    • Added Blit extension method
    • Added FillEllipseCenteredWithRadialGradient method
  • New PickColorConverter class

Comments

Great! Looking forward to use the new Behaviour API. I noticed DisableContextMenu has been removed. After a quick test I could not get the context menu on my chart to open anymore (the only change to my XAML was to remove the said property). I guess this is related to the behaviour activators somehow?
 
Posted by Mikko
Hi Mikko,

Yeah that's gone now because we register event handlers on right mouse down to support behaviours, these seem to be blocking context menus. We're working on a fix for this as another customer has reported this problem. We should have something that solves that problem soon.

One solution we're investigating is to create a behaviour which is responsible for opening the context menu. That works pretty well but for one little niggle which we're working to resolve.

We'll definitely keep you posted as soon as we have a solution.

Jesse
 
Posted by Jesse
Hi, have you a sample for the new PointRendered ? I do this: void serie_PointRendered(object sender, PointRenderedEventArgs<Path> e) { if (e.DataPoint.Y.CompareTo(0.0)>0.0) { (sender as ColumnSeries).PointFill = new SolidColorBrush(Colors.Green); } if (e.DataPoint.Y.CompareTo(0.0) < 0.0) { (sender as ColumnSeries).PointFill = new SolidColorBrush(Colors.Red); } } but its not the good answer. thx
 
Posted by Sylvain
Hi Sylvain,

You're very close. The PointRenderedEventArgs<Path> contains the actual shape object that is going to be added to the chart for that data point. So in your example you probably want something like:

void serie_PointRendered(object sender, PointRenderedEventArgs<Path> e) 
{

    if (e.DataPoint.Y.CompareTo(0.0)> 0.0) 
    { 
        e.Element.Fill = new SolidColorBrush(Colors.Green); 
    } 
    if (e.DataPoint.Y.CompareTo(0.0) < 0.0) 
    { 
        e.Element.Fill = new SolidColorBrush(Colors.Red); 
    } 
}


Importantly the generic type on the PointRenderedEventArgs will tell you what kind of object e.Element is going to be (in this case a Path).

Jesse
 
Posted by Jesse
Hi, I'm trying to upgrage Visiblox.Charts.Wpf from 2.3.1.28393 to 3.0.0.5889 and I get "Value does not fall within the expected range" exception. System.Windows.Media.Imaging.CachedBitmap.InitFromMemoryPtr(Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat, BitmapPalette palette, IntPtr buffer, Int32 bufferSize, Int32 stride) в System.Windows.Media.Imaging.CachedBitmap..ctor(Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat, BitmapPalette palette, Array pixels, Int32 stride) в System.Windows.Media.Imaging.BitmapSource.Create(Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat, BitmapPalette palette, Array pixels, Int32 stride) в Visiblox.Charts.WriteableBitmapAdapter.CreateNewImage() в Visiblox.Charts.BitmapManager.GetImage() в Visiblox.Charts.RasterChartSeriesBase`2.InvalidateBase() в Visiblox.Charts.RasterChartSeriesCommonBase.DoInvalidate() в Visiblox.Charts.Primitives.InvalidationHandler.#=qsbI2y$ucpwK4BF3uiDUX9obUSGsaTSbkZqmeUBkqb5c=() в Visiblox.Charts.Primitives.InvalidationHandler.#=qRMIt93I_MiSVLJxC3hWrzMe8SzKkp8RCCDihfwu6svQ=(Object #=qu10$OyYts3HTePVnaAVkLg==, EventArgs #=qBSFEPTv2rOrzAbLqp8xG3Q==) в System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) в System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
 
Posted by Alex
Hi Alex, Thanks for the example project you sent us - we were able to diagnose the bug and will include a fix for it in v3.0.3. Regards, Partha
 
Posted by Partha
Hi, you mention the new 'StaircaseBandSeries' chart type in the documentation and in this post, however it is missing in the Visiblox.Charts.dll (WPF) library. Are you planning to add this chart type to the WPF version of Visiblox?
 
Posted by Pavel
Hi Pavel, We've reconsidered the availability of StaircaseBandSeries and it will now be available in all editions and on all platforms (including WPF). This change will come into effect after the next minor release. Regards, Partha
 
Posted by Partha
Hi, great that keyboard modifiers are supported. Where can i find them in the interface so that i can enable panning when the control button is down ?
 
Posted by andy
Hi Andy,

Here's a sample code of how to enable panning when the control key is down:
<charts:Chart x:Name="chart" LegendVisibility="Collapsed">
    <charts:Chart.Behaviour>
        <charts:PanBehaviour>
            <charts:PanBehaviour.BehaviourActivator>
                <charts:ModifierKeysBehaviourActivator ControlKey="True" />
            </charts:PanBehaviour.BehaviourActivator>
        </charts:PanBehaviour>
    </charts:Chart.Behaviour>
</charts:Chart>

You can read this blog post for more information on the chart behaviours.

Fros
 
Posted by Fros

Post a comment