Problem with In-Code-Export

6 posts, 0 answers
  1. Felix
    Felix avatar
    11 posts
    Member since:
    Jul 2012

    Posted 27 Sep 2012 Link to this post

    I create an RadChart in the code and i want to export it to a file "png".
    I disabled animations!

    Now the point is in PieSeriesDefinition & LineSeriesDefinition this is correctly working, but in the BarSeriesDefinition & StackedBarDefinition is painting everything except of the bars!

    See screenshots..

    Any clue why this could occur? I think the BarSeries has some additional Animations?


  2. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 01 Oct 2012 Link to this post

    Hello Felix,

    Indeed currently there is a problem with the print/export bar series type in this scenario and you will need to apply this custom bar style manually, which explicitly sets the Opacity to 1:
    <Style x:Key="PrintStyle" TargetType="telerik:Bar">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="telerik:Bar">
                    <Canvas Opacity="1" x:Name="PART_MainContainer">
                        <Rectangle x:Name="PART_DefiningGeometry"                                  
                                    Height="{TemplateBinding ItemActualHeight}"
                                    Width="{TemplateBinding ItemActualWidth}"
                                    Style="{TemplateBinding ItemStyle}"
                                    RadiusX="{StaticResource BarRadiusX}"
                                    RadiusY="{StaticResource BarRadiusY}" />
                        <Rectangle Height="{TemplateBinding ItemActualHeight}"
                                    Width="{TemplateBinding ItemActualWidth}"
                                    RadiusX="{StaticResource BarMaskRadius}"
                                    RadiusY="{StaticResource BarMaskRadius}"
                                    OpacityMask="{StaticResource BarOpacityMaskBrush}"
                                    Fill="{StaticResource BarMaskBrush}"
                                    Stroke="{StaticResource BarMaskStroke}"
                                    StrokeThickness="{StaticResource BarMaskStrokeThickness}" />
                        <Rectangle x:Name="PART_SelectedState"
                                    Height="{TemplateBinding ItemActualHeight}"
                                    Width="{TemplateBinding ItemActualWidth}"
                                    RadiusX="{StaticResource BarRadiusX}"
                                    RadiusY="{StaticResource BarRadiusY}"
                                    Fill="{StaticResource BarTopMaskBrush}" />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    Hope this helps.

    Kind regards,
    Nikolay
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Felix
    Felix avatar
    11 posts
    Member since:
    Jul 2012

    Posted 01 Oct 2012 Link to this post

    Sounds promising, where do i get the missing static resources?
  5. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 04 Oct 2012 Link to this post

    Hello Felix,

    You only need to apply the aforementioned style to the bar series. Please, find attached a sample application demonstrating this.

    Greetings,
    Nikolay
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Felix
    Felix avatar
    11 posts
    Member since:
    Jul 2012

    Posted 05 Oct 2012 Link to this post

    Hello Nikolay,

    It works! Thanks! This will be fixed in the next release?


    Kind regards
    Felix
  7. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 09 Oct 2012 Link to this post

    Hi Felix,

    Our developers are aware of this issue, however, we cannot commit to a concrete time frame for the implementation of the fix and for the time being we would recommend using the available workaround.

    We would also highly recommend our new ChartView control for scenarios as this one, as it addresses some of the shortcomings of RadChart and has other various improvements.

    Kind regards,
    Nikolay
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready