We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

When open .xlsx file, chart is not visible in SfSpreadsheet

Hi

I'm just testing Syncfusion SfSpreadsheet in WPF.

I wrote a simple program to open Excel 2016 file. In my Excel file there are only one sheet for date and one chart (column chart).

After workbook open, in my application the data sheet is well created and data are visible.

There is tab created for chart but the chart is not displayed.

The xaml code:

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp1"
        xmlns:Syncfusion="http://schemas.syncfusion.com/wpf" x:Class="MainWindow"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Syncfusion:SfSpreadsheet x:Name="LaGrille" Grid.Row="0"/>
        <Button Content="Test" Grid.Row="1" Click="Button_Click"/>
    </Grid>
</Window>


The VB code:

Class MainWindow
    Public Sub New()

        ' Cet appel est requis par le concepteur.
        InitializeComponent()

        ' Ajoutez une initialisation quelconque après l'appel InitializeComponent().

    End Sub
    Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
        LaGrille.Open("C:\Users\patri\Documents\Test graph.xlsx")
    End Sub
End Class


I have the same result with one .xls file.

What's wrong ? My code ? SfSpreadsheet is not able to display chart in WPF ?

Thanks for your support.

Attachment: Test_graph_2530c2d4.7z

3 Replies

KB Kanimozhi Bharathi Syncfusion Team January 9, 2017 11:08 AM UTC

Hi Patrice Thominot, 
 
For importing charts in SfSpreadsheet,  you need to add “Syncfusion.SfSpreadsheetHelper.WPF.dll “assembly as reference into the application. Create an instance of Syncfusion.UI.Xaml.SpreadsheetHelper.GraphicChartCellRenderer and add that renderer into GraphicCellRenderers collection by using the helper method AddGraphicChartCellRenderer which is available under the namespace Syncfusion.UI.Xaml.Spreadsheet.GraphicCells. 
 
Please refer the below UG link for your reference, 
 
 
We have also prepared a sample for your reference, please find the sample link below, 
 
 
Regards 
Kanimozhi B 



PT Patrice THOMINOT January 9, 2017 08:22 PM UTC

Hi

Thanks a lot, all is OK now

Regards


KB Kanimozhi Bharathi Syncfusion Team January 10, 2017 09:45 AM UTC

Hi Patrice Thominot, 
  
Thank you for your update. 
  
Regards 
Kanimozhi B 


Loader.
Up arrow icon