private void ExportSilverlightButton_Click(object sender, EventArgs e) { try { string path = Application.StartupPath + "\\ChartExport.xaml"; NXamlImageFormat fmt = new NXamlImageFormat(); nChartControl1.ImageExporter.SaveToFile(path, fmt); Process.Start(path); } catch (Exception x) { MessageBox.Show(x.Message); } }
private void ExportButton_Click(object sender, EventArgs e) { try { string path; NImageFormat imageFormat; if (sender == btnExportToSwf) { path = System.IO.Path.Combine(Application.StartupPath, "ChartExport.swf"); imageFormat = new NSwfImageFormat(); } else { path = System.IO.Path.Combine(Application.StartupPath, "ChartExport.xaml"); imageFormat = new NXamlImageFormat(); } NAnimationTheme animationTheme = new NAnimationTheme(); animationTheme.AnimateSeriesSequentially = AnimateSeriesSequentiallyCheck.Checked; animationTheme.AnimateDataPointsSequentially = AnimateDataPointsSequentiallyCheckBox.Checked; animationTheme.AnimateChartsSequentially = AnimateChartsSequentiallyCheckBox.Checked; animationTheme.AnimatePanelsSequentially = AnimatePanelsSequentiallyCheckBox.Checked; animationTheme.AnimateGaugesSequentially = AnimateGaugesSequentiallyCheckBox.Checked; animationTheme.WallsAnimationDuration = (float)WallsAnimationDurationUpDown.Value; animationTheme.AxesAnimationDuration = (float)AxesAnimationDurationUpDown.Value; animationTheme.SeriesAnimationDuration = (float)SeriesAnimationDurationUpDown.Value; animationTheme.IndicatorsAnimationDuration = (float)IndicatorsAnimationDurationUpDown.Value; animationTheme.AnimationThemeType = (AnimationThemeType)AnimationThemeTypeComboBox.SelectedIndex; animationTheme.Apply(nChartControl1.Document); nChartControl1.ImageExporter.SaveToFile(path, imageFormat); Process.Start(path); } catch (Exception x) { MessageBox.Show(x.Message); } }