Charting for WPF 1.8

MindFusion has released a new version of its Charting component for Wpf with the following new features:

Styles and Themes
Styles define the appearance of individual chart elements such as the axis, the series and the legend. Each ChartTheme contains a collection of styles and defines the appearance of the whole chart. The new version lets you:

  • create themes based on the appearance of an existing chart;
  • create themes with the ThemeEditor tool;
  • save themes to XML files;
  • load themes from XML files;
  • use a number of predefined themes.

The “Working with Themes” tutorial gives detailed information on how to create, save, load and edit themes with MindFusion.Charting for WPF.

The green theme

The green theme

Improved Design Time Support
You can now edit all collection properties, including the Series collection, the brushes and strokes in design time through the property grid.

Axis Intervals
The new AxisSettings.IntervalCount property lets you specify the exact number of intervals at the axis. In such case, the control does not use the Interval property and calculates the value of each interval based on AxisSettings.Min, AxisSettings.Max and AxisSettings.IntervalCount properties.

You can read further details about the release and the other new features at the news section in the Charting forum. A trial version is available for download from here:

Download MindFusion.Charting for WPF 1.8 Trial Version

You are welcome to contact us with any questions, problems or inquiries about the Charting for Wpf control or any other of our products. MindFusion has always put special emphasis on providing excellent customer support and we usually answer your inquiries in a few hours of receiving them.

About MindFusion.Charting for Wpf: A programming component that combines powerful charting capabilities with an elegant API and easy use. Among the features of the control are fully customizable grid, positive and negative values on all chart axes, 3D charts, gauges and many more – read a detailed list here.

The control provides detailed documentation and various samples that demonstrate how to customize every type of chart. It supports a wide range of 2D and 3D charts including bar, line, radar, bubble pie etc. You can add tooltips, define themes, perform hit testing, zoom and more.

MindFusion Pack for Silverlight 2013.R1

MindFusion has released a new version of its Silverlight controls suite. There are new features in many of the controls, here are details:

Visual Studio 2012 Support

New assemblies for all components targeting Silverlight 5 are available. Additionally all samples provide versions for Visual Studio 2012.

chartMindFusion.Charting

Radar and Polar charts
The Silverlight charting control adds a brand new types of charts – radar and polar charts. They support unlimited number of data series, 4 label types at the inner and outer axes, spiderweb, scatters and many more.

Radar chart

Radar chart

Hit testing
The new HitTest method returns a list of all ChartElement objects, which contain the specified point. Each chart type has its own ChartElement-derived class, which exposes properties for the hit object – data, labels, value etc.

Visual Effects
All chart types support the System.Windows.Media.Effects.DropShadowEffect and System.Windows.Media.Effects.Blur effect. Use the Effect property to specify the chosen effect.

diagram16x16MindFusion.Diagramming

Node Effects
You can apply to nodes two visual effects, represented by the GlassEffect and AeroEffect classes. Effects can be added, removed or modified at any time and this will immediately reflect on the diagram. Effects of different types can be applied simultaneously.

Themes and Theme Editor
A theme in DiagramLite is a set of styles, each associated with a specific item type. When the theme is applied to a diagram, the styles registered in the theme affect all objects of their associated type. Styles are associated with item types within the theme through the RegisterStyle method. The package also includes a Theme Editor tool that provides simple visual environment for theme creation and modification. There are also several predefined themes available in the Themes subfolder of the installation root folder.

Diagram documents and tabbed views
The DiagramDocument class represents a collection of diagram pages or sheets, represented by DiagramPage objects. New pages can be added to the document and existing pages can be removed and reordered via the Pages collection.

The new TabbedDiagramView can be used to display DiagramDocument objects. The view displays a tab for each page in the document. You can change the active page, add and remove pages as well rearrange them by dragging with the mouse.

One-way graph Layout
The OneWayLayout class ensures that links enter into nodes from the same general direction and exit them from the opposite side. If the graph contains cycles, some links bend around the nodes to keep the enter/exit direction consistent. The algorithm aims to minimize the number of such links.

One Way Graph Layout

One Way Graph Layout

Multiple labels per link
The LinkLabel class allows multiple captions to be displayed for a single DiagramLink object. Link labels provide a set of properties allowing full customization of their display and positioning. The labels support automatic arrangement.

Layers
Items can now be assigned to layers, and layers can be hidden, locked or moved up/down in the Z order as a group. Set the LayerIndex property of items to associate them with layers in the Diagram.Layers collection. The Layer objects provide Visible, Locked and ZIndex properties, which affect all items in the respective layer. Layers also expose a Title property shown in the LayerListView control.

Layer list control
The LayerListView control provides user interface for working with Layer objects. The control displays a list of all layers in a specified Diagram with a title and an overview area, and also allows editing of layer’s Title, Visible and Locked properties and choosing the Diagram’s currently active layer.

Magnifier
The new magnifier tool lets you interactively zoom in (or out) portions of the diagram by holding down a modifier key or pressing a mouse button. The magnifier’s zoom factor and size are
customizable.

The Magnifier Tool

The Magnifier Tool

Report-16x16MindFusion.Reporting

Side-By-Side Containers
You can arrange items in the report parallelly by putting them inside the new SideBySideContainer report item. One of the uses is to display two (or more) data ranges next to each other.

Miscellaneous

  • New DefaultEncoding property in PdfExporter;
  • New Median aggregate function;
A sample report

A sample report

Calendar-16x16MindFusion.Scheduling

Improved item presenter
The ItemPresenter class now provides the start and end time of the represented item fragment through the new StartTime and EndTime properties. In addition, derived classes can override the new OnStartTimeChanged, OnEndTimeChanged, and OnItemPropertyChanged methods to get notified when the StartTime or EndTime properties change or when any property of the underlying item changes.

Improved recurrence
The Recurrennce class exposes a new event – ValidateOccurrence, which can be used to validate and customize the occurrences of a recurrence pattern.

A sample schedule

A sample schedule

You can read further details about the release at the forum. A trial version is available for download from here:

Download MindFusion Silverlight Pack R1.2013

Technical Support
You are welcomed to post your questions at the forum section of the respective product. You can also use the help desk or the support e-mail. MindFusion puts special effort in providing fast and competent technical support to everyone using our products.

About MindFusion.Silverlight Pack: A set of advanced Silverlight components that help you build your business application easy and on time. The tools provide you with a complete set of features for creating, editing and rendering complex flowcharts, charts, diagrams, calendars, maps, schedules and reports. A set of gauges and UI elements is also included. Each component offers various samples, tutorials and detailed documentation. The controls offer simple and intuitive API, completely customizable appearance, numerous input/output options and a rich event set. Each tool has been thoroughly tested to guarantee that you and your application get the high quality and performance you deserve.

MindFusion Diagram Viewer Library for Android

You can show now your diagrams and flowcharts on any Android device. With MindFusion DiagramViewer library for Android you can load any diagram, created by any MindFusion diagramming component and exported to XML. Currently, the diagram viewer supports the following item types:

  • ShapeNode
  • ContainerNode
  • TableNode
  • TreeViewNode
  • DiagramLink
Diagrams in Android mobile devices

Diagrams in Android mobile devices

The library includes all model classes and properties from MindFusion’s Java diagramming library. This provides your Android applications with access to the loaded links and nodes and their data properties, along with methods for simple hit testing from touch events. Here is a link to the online documentation of the Java diagramming component:

MindFusion.Diagramming for Java online reference.

MindFusion diagram viewer for Android is free of charge for anyone with a license for any MindFusion.Diagramming component – you can learn more about the tools here.

We have prepared a deteiled guide on how to use the library in an Android application. You can read the tutorial from here:

Tutorial: How to Render a Diagram in an Android Application

Real Time Line Chart

In today’s post we are going to build a real time line chart with the following features:

  • 8 data series with 100 points each.
  • Ten times per second we add 10 random points to each series and remove the last ten.
  • Each tenth of the second we update the min and max values of the X-axis.
  • Legend
The final chart

The final chart

Create the series

We create 8 series and add them to the Series collection of the chart:

for (int i = 0; i < 8; i++)
{
     LineSeries series = new LineSeries();
     series.StrokeThickness = 3;
     series.Strokes.Add(RandomStroke);
     series.Fills = series.Strokes;
     series.Title = "Series" + i;
     series.XData = new DoubleCollection();
     series.YData = new DoubleCollection();

     for (int j = 0; j < 100; j++)
     {
        series.XData.Add(j);
        series.YData.Add(10 + 10 * i + random.Next(-5, 5));
      }

     lineChart.Series.Add(series);
 }

Each series is drawn with a random generated stroke:

  private Brush RandomStroke
  {
     get
     {
        byte r = (byte)random.Next(0, 255);
        byte g = (byte)random.Next(0, 255);
        byte b = (byte)random.Next(0, 255);
        return new SolidColorBrush(Color.FromArgb(255, r, g, b));
       }
     }

We must set the Title and Fills properties though we don’t need them for the chart – they are used by the legend. The Y-values of the line points are random numbers between 10 and 90.

The Legend

ChartLegend legend = new ChartLegend();
legend.Series = lineChart.Series;
lineChart.Legends.Add(legend);

Our legend is of type ChartLegend, which means we must set its Series property to the list of ChartSeries that the legend explains. The ChartLegend reads the labels for its items from the Title property of a ChartSeries. It draws the series rectangles with the first brush in ChartSeries.Strokes and fills them with the first brush in ChartSeries.Fills. That’s why it was important to set the Title, Fills and Strokes properties as shown above.

The Axis
The axis shows scale divisions with interval 10. Initially they range from 0 to 100 in 10 intervals.

lineChart.XAxisSettings.MinValue = 0;
lineChart.XAxisSettings.Interval = 10;
lineChart.XAxisSettings.LabelType = LabelType.AutoScale;

Updating Data in Real Time

We create a timer that simulates reading real time data. The timer ticks ten times every second:

timer.Interval = TimeSpan.FromMilliseconds(100);
timer.Tick += new EventHandler(OnTimerTick);

When the timer ticks, we generate ten new values for each of the eight series, add them to each series and remove the last ten values:

foreach (LineSeries series in lineChart.Series)
{
    for (int i = 10 - 1; i >= 0; i--)
    {
         series.XData.Remove(series.XData[i]);
         series.YData.Remove(series.YData[i]);
    }
}

foreach (LineSeries series in lineChart.Series)
{
    int counter = 0;
    for (int i = 0; i < 10; i++)
    {
         series.XData.Add(i + maxX);
         series.YData.Add(10 + counter * 10 + random.Next(-5, 5));
     }
     counter++;
}

Here we use a global variable maxX, which we have declared in the class:

private int maxX = 100;

We increase our global variable with 10 to keep up with the change in the data:

maxX += 10;

Updating the Axis
At each tick of the timer we increase the start of the axis with 10:

lineChart.XAxisSettings.MinValue += 10;

Performance Optimization
Performance is greatly improved if we set the thickness of the lines to 1 rather than 3. The reason for this is that Windows GDI system draws thick lines by filling polygons. This requires numerous calculations about the coordinates of each polygon. When the thickness is small, Windows GDI draws lines rather than polygons, which speeds up drawing and performance.

series.StrokeThickness = 3;

Download of the Sample
You can download the sample with complete source code from here:

Download the Sample

MindFusion.Scheduling Pack R1.2013

MindFusion has just released a new version of its Scheduling Pack. Here are details about the new features in the components that are included in the pack:

Visual Studio 2012 support

MindFusion.Scheduling Pack R1.2013 supports Visual Studio 2012. The installer can create VS2012 toolbox palette for the components, and can optionally install VS2012 sample projects. In addition, toolbox palettes are now created for all .NET target frameworks supported by the respective Visual Studio versions.

ASP-Net-16x16MindFusion.Scheduling for ASP.NET

  • Interactive resize of items in all views.
  • Some of the CSS classes have been renamed to provide better consistency across themes. Check the updated CSS Classes topic for details.
  • The bundled jQuery version has been upgraded to 1.9.
A sample monthly schedule.

A sample monthly schedule.

NET-WinForms-16x16MindFusion.Scheduling for WinForms

Exporting
You can now export calendars to PDF files with the new PdfExporter.

Improved Custom Drawing
Items, including their shadows, can now be completely custom-drawn through the new ItemDrawing event. The
ItemDrawing event is raised before the item is rendered by the system and can be used to prevent the default item rendering. Two new events added to the Calendar class signal the start and end of the item drawing phase respectively – BeginItemDrawing and EndItemDrawing.

Miscellaneous

  • All resource collections now implement IList where T is the type of resources in the collection.
  • The GetExactDateAt method works more consistently in various scenarios.
  • Custom texts and icons can be supplied to the Print Preview form of the scheduling reports.
  • All texts within the calendar can be customized explicitly through the new CustomizeText event of the Calendar class.

WPF-16x16Silverlight-16x16MindFusion.Scheduling for Silverlight / WPF

Improved item presenter
The ItemPresenter class now provides the start and end time of the represented item fragment through the new StartTime and EndTime properties. In addition, derived classes can override the new OnStartTimeChanged, OnEndTimeChanged, and OnItemPropertyChanged methods to get notified when the StartTime or EndTime properties change or when any property of the underlying item changes.

Item recurrence

Item recurrence

Improved recurrence
The Recurrence class exposes a new event – ValidateOccurrence, which can be used to validate and customize the occurrences of a recurrence pattern.