-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_2_export_multiple_charts.cs
40 lines (32 loc) · 1.28 KB
/
example_2_export_multiple_charts.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using FusionCharts.FusionExport.Client; // Import sdk
namespace Examples
{
public static class example_2_export_multiple_charts
{
public static void Run(string host = Constants.DEFAULT_HOST, int port = Constants.DEFAULT_PORT)
{
// Instantiate the ExportConfig class and add the required configurations
ExportConfig exportConfig = new ExportConfig();
List<string> results = new List<string>();
string chartConfigFile = System.Environment.CurrentDirectory + "\\..\\..\\resources\\multiple.json";
// Instantiate the ExportManager class
using (ExportManager exportManager = new ExportManager())
{
exportConfig.Set("chartConfig", chartConfigFile);
exportConfig.Set("templateFormat", "A4");
exportConfig.Set("type", "pdf");
// Call the Export() method with the export config
results.AddRange(exportManager.Export(exportConfig, System.Environment.GetEnvironmentVariable("%TMP%", EnvironmentVariableTarget.User), true));
}
foreach (string path in results)
{
Console.WriteLine(path);
}
Console.Read();
}
}
}