Dashed lineseries

14 posts, 0 answers
  1. Jeroen
    Jeroen avatar
    49 posts
    Member since:
    Feb 2012

    Posted 12 Nov 2012 Link to this post

    Hey guys,

    Unable to get my lines dashed. Looked around the forum and tried lots of suggestions. I'm aware of the bug in Silverlight that f*cks up the style after zooming and what-not, and applied the suggested fix. Currently the closest I'm getting to getting any kind of style to work properly is like this:

    private static Style CreateCustomLineStyle()
            {
                Style customLineStyle = new Style(typeof(LineSeries));
                Style borderLineStyle = new Style(typeof(Shape));
                borderLineStyle.Setters.Add(new Setter(Shape.StrokeDashArrayProperty, "5,10"));
                borderLineStyle.Setters.Add(new Setter(Shape.StrokeThicknessProperty, 5));
                borderLineStyle.Setters.Add(new Setter(Shape.StrokeProperty, new SolidColorBrush(Colors.Red)));
                customLineStyle.Setters.Add(new Setter(LineSeries.BorderLineStyleProperty, borderLineStyle));
     
                return customLineStyle;
            }
     
            private void ZoomScrollSettingsPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
            {
                //if (e.PropertyName == "RangeStart" || e.PropertyName == "RangeEnd")                     
                radChart1.DefaultView.ChartArea.DataSeries[0].Definition.SeriesStyle = CreateCustomLineStyle();
            }

    This actually makes the (first) lineseries 5 points fat and red like you'd expect, so these style settings are definitely applied (originally the line is 1pt and yellow). However, there are no dashes to be seen anywhere, and with a "5,10" value you'd expect to easily distinguish the dashed line from a solid one.

    All lineseries are created in code-behind and added like this:
    radChart1.DefaultView.ChartArea.DataSeries.Add(...)

    Any help much appreciated.
  2. Jeroen
    Jeroen avatar
    49 posts
    Member since:
    Feb 2012

    Posted 14 Nov 2012 Link to this post

    Anyone?
  3. DevCraft banner
  4. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 15 Nov 2012 Link to this post

    Hello Jeroen,

    After some investigation I can confirm that this is a bug in the control. I have logged it as such in our PITS where you can vote and track its status. I have updated you Telerik points as a thank you for bringing this problem to our attention. The fix will most likely be available with the next service pack (at the end of this month). 

    All the best,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Jeroen
    Jeroen avatar
    49 posts
    Member since:
    Feb 2012

    Posted 19 Dec 2012 Link to this post

    Has this been fixed? I've upgraded to the latest version today (v.2012.1.326.1050 Dev), and it's still the same.
    The issue in the PITS says "resolved", but I'm still not seeing any dashed lines. Other properties, like StrokeThicknessProperty and StrokeProperty are updated correctly, but StrokeDashArrayProperty still has no effect.
  6. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 20 Dec 2012 Link to this post

    Hello Jeroen,

    The version you have indicated is not the latest, it is from Q1, March 26th. You can get the LIB from your account -> Manage Products -> Latest Internal Builds.

    Greetings,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Jeroen
    Jeroen avatar
    49 posts
    Member since:
    Feb 2012

    Posted 26 Dec 2012 Link to this post

    Ok... I thought the upgrade wizard from within VS would take care of, well, upgrading the Telerik tools to the latest version, but I guess that's not how it works...

    So I've installed the latest version first (Q3) using the 'Telerik Control Panel'. I've then replaced the relevant directories in the 'RadControls for Silverlight Q3 2012' folder with the directories from the hotfix, and then ran the upgrade wizard from within VS. Everything's compiling and running fine, the version number for the referenced Telerik files are '2012.3.1224.1050' (which seems recent enough), but I'm still not seeing any dashed lines...

    Do you happen to have some example code of a chart using dashed lines? And I do mean chart, not chartview; because of project legacy I'm a bit stuck with the older charts for now...
  8. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 31 Dec 2012 Link to this post

    I have attached to this post a very basic application, based on the code you provided earlier. I have also attached a snapshot of the results this project produces. When I run the app, all is as expected, I see a blue dashed line. Do try this and see how it goes.

    Regards,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  9. Jeroen
    Jeroen avatar
    49 posts
    Member since:
    Feb 2012

    Posted 07 Nov 2013 Link to this post

    I've revisited this problem because we're now in a situation where we could really use those dashed lines.

    The problem seems to be theme related. We use Expression Dark in our application, and the bug is easily reproducable if you simply set the theme of the chart to Expression_Dark:

    <chart:RadChart telerik:StyleManager.Theme="Expression_Dark" ... >

    The problem is also present in the example project that Peter posted here. Other themes don't seem to have the problem.

    In order to get this fixed ASAP, I'd probably need to fix the theme itself. I'm guessing I'd need to make some changes in a file like 'Telerik.Windows.Controls.DataVisualization.xaml', but I'm not sure what I'm looking for.

    Preferrably I'd see this properly fixed in the next release of course, but we really need this fix within the next few days. So any help greatly appreciated.
  10. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 08 Nov 2013 Link to this post

    Hi Jeroen,

    I am unable to reproduce the exception you describe. I have attached a small project that demonstrates the chart working properly with Expression_Dark and a stroked series. If you still experience problems - please send us a small runnable project so that we can investigate.

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  11. Jeroen
    Jeroen avatar
    49 posts
    Member since:
    Feb 2012

    Posted 08 Nov 2013 Link to this post

    Still not working properly.

    First of all, when I add this line

    radChart1.SeriesMappings[0].SeriesDefinition.SeriesStyle = CreateCustomLineStyle(Colors.Brown);

    to the end of the constructor, the line is brown but isn't dashed (when using Expression_Dark). When using another theme the line IS properly dashed.

    Secondly, the line DOES becomes red and dashed when I press the button (even when using Expression_Dark), but as soon as I change the zoom level of the chart, it fails to render any dashed lines ever again (this bug is apparently present in all themes).
  12. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 13 Nov 2013 Link to this post

    Hello Jeroen,

    I have verified the described behavior and I can confirm that this is a bug in the control. I have logged it in our system and have updated your Telerik points.

    Unfortunately I cannot suggest a work-around for this. I can again suggest you migrate to the new ChartView as it resolves many of the limitations of the old chart, it is generally more flexible for set up, has a greater performance rate and does not have such a bug.

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  13. Jeroen
    Jeroen avatar
    49 posts
    Member since:
    Feb 2012

    Posted 13 Nov 2013 Link to this post

    Unfortunately there's a also another bug in the controls that prevents me from using old charts and the new chartview charts within the same application, so I'd have to upgrade every single chart in the application and that's just not an option right now. So I hope this chart bug can be fixed quickly...
  14. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 13 Nov 2013 Link to this post

    Hello Jeroen,

    Do you mean to say that there is a bug when using the two charts in one application? We do not know of such a bug. Can you give us more details?

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  15. Jeroen
    Jeroen avatar
    49 posts
    Member since:
    Feb 2012

    Posted 13 Nov 2013 Link to this post

    I reported it a while ago. Unfortunately I needed to move on to more pressing matters at the time and I was forced to stick to the old charts. Because of some other bugs I encountered (and reported) with ChartView, we pretty much had to classify the ChartView as unusable until further notice... Haven't been able to revisit these issues, because well, we have charts that work, maybe not perfectly, but they work. You know how it is.

    http://www.telerik.com/community/forums/silverlight/charting-kit/radcartesianchart-the-property-labelstyle-was-not-found-in-type-telerik-windows-controls-charting-axis.aspx

Back to Top
DevCraft banner