Chart Features - Grouped Axis

by Avatar Bill Henning (Actipro)
Tuesday, May 14, 2013 at 7:51am

ChartsBlogPostBanner

In the latest WPF and Silverlight controls maintenance releases, we've added some important functionality to our Charts product. In the initial release, we could chart quantifiable values (such as numerics and DateTime) on a Cartesian axis. Now we've added the ability to chart strings and other complex types using our new XYGroupedAxis.

Grouped Axis Example

Take this complex type as an example:

class Transaction {
    public double Price { get; set; }
    public string SalesPersonName { get; set; }
}

Given we have a collection of Transaction objects on our data context...

public ObservableCollection<Transaction> Transactions;

...then we can bind our BarSeries.ItemsSource to the collection of Transactions. The primary axis is our numeric value (Price), and the secondary axis is our string (SalesPersonName). Those are specified using YPath and XPath, respectively.

<XYChart>
    <XYChart.Series>
        <BarSeries ItemsSource={Binding Transactions} 
                    XPath="SalesPersonName" YPath="Price"/>
    </XYChart.Series>
</XYChart>

If our transaction data looks like this:

SalesPersonName

Price

Mary

300

Marcus

100

Steve

250

Marcus

200

Mary

50

Mary

100

Marcus

50

Now our chart will look like so:

Chart1

Notice how on the x-axis, the strings are grouped by equality. So all transactions for Marcus, Mary, and Steve are grouped into single bars. Also notice how on the primary axis, the numeric values are summed together for each group. So for Mary, who had transactions of 300 + 50 + 100, the grouped value becomes 450.

Further Customization

There are several customization options -- you can change how items are grouped by setting XYGroupedAxis.GroupingFunc. XYGroupedAxis.LabelFunc controls how groups are labeled, and XYGroupedAxis.SortingFunc controls how groups are sorted. Using these, we can take the data above and group by the first letter of the name:

Chart2

Here, notice that grouping is done by comparing the first letter of the name, rather than equality of the entire string. LabelFunc has been specified to show the first letter. Note how the values for Mary and Marcus get summed together on the Y axis.

Summary

XYGroupedAxis allows you to provide custom logic to chart complex types easily. Download the free trials of our WPF or Silverlight controls and check it out!

This same functionality will also be coming to the WinRT XAML version of Charts in its next release.

TaskDownload TaskLiveDemo TaskBuyNow

Code Writer v1.7 Released

by Avatar Bill Henning (Actipro)
Friday, May 10, 2013 at 7:17am

CWBlogPostBanner

We just published v1.7 of Code Writer, our free text/code editor app, to the Windows Store. 

Markdown File Type

This version adds a new Markdown file type. 

Markdown

Markdown is used to provide simple markup formatting to regular text files.

Auto-Case Correct

Auto-case correct (described here) is a feature that just made its way into our latest WPF and Silverlight SyntaxEditor releases.  Basically as you edit certain file types like Visual Basic, VBScript, or PowerShell, when you move off a line, the keywords on the line will auto-case themselves to the proper casing.

AutoCaseCorrectOption

An Editor settings option has been added to allow configuration of whether this feature is active.

Code Block Selection

Code block selection (described here) is a feature where the editor selection can be expanded to include containing code blocks, and then later contracted all the way back down to the caret as appropriate.  This feature has been added to XML and XAML file types in this version.  It is accessible via the Ctrl+= and Ctrl+- hotkeys.

If the caret is in an attribute name, expanding selection will select the full attribute (name and value).  Expanding again selects all attributes in the tag.  Expanding again selects the tag.  Then the containing tag block's content, the entire tag block, and so on up the XML element hierarchy.  It's a really handy feature.

Line Ends

In the past, all files were saved with CR/LF line ends.  This made it difficult to work on files from other operating systems, like Unix or Mac.  In this latest version, we now attempt to detect which line end is being used in a file.  And we save it back out the same way.

LineEndsDocProps

You can override the setting on a per-document basis from the Document Properties pane.

LineEndsOption

There also is a new Editor settings option for designating which line end to use by default for new documents.

Miscellaneous

Several other handy features have been added:

  • .rss and .atom extensions for the XML file type.
  • Auto-fill the find text from editor selection when the Find/Replace Pane opens.
  • Rearchitected internal file management to better support future features.
  • Improved text rendering performance.

Summary

Auto-case correct and line end customization were features requested by our users.  Please keep the suggestions coming and enjoy this new version.

Go to the Windows Store to download it, and help us by tweeting about the app!

TaskWideLearnMore TaskWideWindowsStore

WPF Controls 2013.1 Build 581 Released

by Avatar Bill Henning (Actipro)
Wednesday, May 8, 2013 at 8:16am

BlogPostBanner

WPF Studio 2013.2 build 581 has been released and is now available for download. This maintenance release contains some massive new features and updates for the WPF controls.

This build has the following major new features:

  • Charts: Added the ability to provide strings and complex types as chart data using the new XYGroupedAxis.
  • Charts: Added support for multilevel XPath and YPath.
  • Docking/MDI: Update the layout serialization to save/restore standard MDI layout information.
  • Ribbon: Updated TaskTabItem controls to support key tips.
  • SyntaxEditor: Added new auto-correct features, with a pre-defined AutoCaseCorrector language service for performing character case correction.  Easily add auto-case correct features to custom languages.
  • SyntaxEditor: Updated the sample VB, VBScript, and PowerShell languages to perform auto-case correction.
  • SyntaxEditor: Added new code block selection features, which let languages that implement an ICodeBlockFinder service expand/contract the selection to logical code blocks via Ctrl+Num+ and Ctrl+Num-.
  • SyntaxEditor: Added a new free Markdown syntax language definition.
  • SyntaxEditor: Made performance improvements in numerous areas.
  • SyntaxEditor .NET Languages Add-on: Added an IAutoCorrector language service implementation for VB that case corrects keywords.
  • SyntaxEditor .NET Languages Add-on: Added ICodeBlockFinder language service implementations for C# and VB.
  • SyntaxEditor .NET Languages Add-on: Updated the resolver to handle the implicit value parameter in property setters.
  • SyntaxEditor .NET Languages Add-on: Improved the C# text formatter.
  • SyntaxEditor Web Languages Add-on: Added ICodeBlockFinder language service implementations for XML.
  • All: Made numerous minor enhancements and updates.

See the announcement post for the detailed list of enhancements and updates.

TaskDownload TaskLiveDemo TaskBuyNow

Silverlight Controls 2013.1 Build 151 Released

by Avatar Bill Henning (Actipro)
Wednesday, May 8, 2013 at 7:59am

BlogPostBanner

Silverlight Studio 2013.1 build 151 has been released and is now available for download.  Several great new enhancements are part of this build.

This build has the following major new features:

  • Charts: Added the ability to provide strings and complex types as chart data using the new XYGroupedAxis.
  • Charts: Added support for multilevel XPath and YPath.
  • SyntaxEditor: Added new auto-correct features, with a pre-defined AutoCaseCorrector language service for performing character case correction.  Easily add auto-case correct features to custom languages.
  • SyntaxEditor: Updated the sample VB, VBScript, and PowerShell languages to perform auto-case correction.
  • SyntaxEditor: Added new code block selection features, which let languages that implement an ICodeBlockFinder service expand/contract the selection to logical code blocks via Ctrl+Num+ and Ctrl+Num-.
  • SyntaxEditor: Added a new free Markdown syntax language definition.
  • SyntaxEditor: Made performance improvements in numerous areas.
  • SyntaxEditor .NET Languages Add-on: Added an IAutoCorrector language service implementation for VB that case corrects keywords.
  • SyntaxEditor .NET Languages Add-on: Added ICodeBlockFinder language service implementations for C# and VB.
  • SyntaxEditor .NET Languages Add-on: Updated the resolver to handle the implicit value parameter in property setters.
  • SyntaxEditor .NET Languages Add-on: Improved the C# text formatter.
  • SyntaxEditor Web Languages Add-on: Added ICodeBlockFinder language service implementations for XML.

See the announcement post for the detailed list of enhancements and updates.

TaskDownload TaskLiveDemo TaskBuyNow

SyntaxEditor - Auto-Case Correct

by Avatar Bill Henning (Actipro)
Wednesday, April 24, 2013 at 1:21pm

PostBannerSyntaxEditorDevNotes

Last week we posted about a new Markdown syntax language and new code block selection features coming to our SyntaxEditor code editor in the next 2013.1 maintenance releases of our WPF and Silverlight control products.

In today's post, I'd like to show off another major new feature that will be available:  auto-case correct.

Auto-Case Corrector Services

In the upcoming version, a new AutoCaseCorrector language service is included that can perform case-correction on documents as editing occurs.  This feature works out of the box on any languages (including your own custom ones) that use dynamic lexers, where the case sensitivity of patterns is set to AutoCorrect.

The new language service class can also be inherited and updated to work with programmatic lexers as well, which is what we did in the Visual Basic language in the .NET Languages Add-on.

Auto-correct features will be enabled (if they are implemented for a language) as long as the new SyntaxEditor.IsAutoCorrectEnabled property is set to true.

Case Correct Example

Let's look at a Visual Basic example of this new feature in action.

AutoCaseCorrect1

In this screenshot, I typed in all lowercase on line 23.  Next I pressed the Down key to move to the next line.

AutoCaseCorrect2

The auto-case corrector noticed that I edited the line and moved the caret to a new line, so it went back to auto-correct the previous line.  Note how the For, As, Integer, and To keywords were all cased appropriately.

The auto-correct text change was performed as an undoable change too, meaning the user could undo (Ctrl+Z) it if they weren't happy with the update.

Summary

Auto-case correct is a wonderful addition for any languages that use case-insensitive keywords, such as Visual Basic.  It will greatly improve the end user's editing experience, and is enabled on our Visual Basic, VBScript, and PowerShell languages.

This and other features are ready to go for the upcoming 2013.1 maintenance release, due soon.

TaskDownload TaskLiveDemo TaskBuyNow