Initial commit
This commit is contained in:
commit
79649a1628
8 changed files with 681 additions and 0 deletions
12
QuickChartExamples/QuickChartExamples.csproj
Normal file
12
QuickChartExamples/QuickChartExamples.csproj
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<StartupObject>QuickChartExamples.SimpleExample</StartupObject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\QuickChart\QuickChart.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
28
QuickChartExamples/ShortUrl.cs
Normal file
28
QuickChartExamples/ShortUrl.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using QuickChart;
|
||||
|
||||
namespace QuickChartExamples
|
||||
{
|
||||
public class ShortUrlExample
|
||||
{
|
||||
static void Main(string[] args) {
|
||||
Console.WriteLine("Fetching short url...");
|
||||
Chart qc = new Chart();
|
||||
|
||||
qc.Width = 500;
|
||||
qc.Height = 300;
|
||||
qc.Config = @"{
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
|
||||
datasets: [{
|
||||
label: 'Users',
|
||||
data: [50, 60, 70, 180]
|
||||
}]
|
||||
}
|
||||
}";
|
||||
|
||||
Console.WriteLine(qc.GetShortUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
28
QuickChartExamples/Simple.cs
Normal file
28
QuickChartExamples/Simple.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using QuickChart;
|
||||
|
||||
namespace QuickChartExamples
|
||||
{
|
||||
public class SimpleExample
|
||||
{
|
||||
static void Main(string[] args) {
|
||||
Console.WriteLine("Writing simple URL...");
|
||||
QuickChart qc = new QuickChart();
|
||||
|
||||
qc.Width = 500;
|
||||
qc.Height = 300;
|
||||
qc.Config = @"{
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
|
||||
datasets: [{
|
||||
label: 'Users',
|
||||
data: [50, 60, 70, 180]
|
||||
}]
|
||||
}
|
||||
}";
|
||||
|
||||
Console.WriteLine(qc.GetUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
28
QuickChartExamples/ToFile.cs
Normal file
28
QuickChartExamples/ToFile.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using QuickChart;
|
||||
|
||||
namespace QuickChartExamples
|
||||
{
|
||||
public class ToFileExample
|
||||
{
|
||||
static void Main(string[] args) {
|
||||
Console.WriteLine("Saving to disk...");
|
||||
Chart qc = new Chart();
|
||||
|
||||
qc.Width = 500;
|
||||
qc.Height = 300;
|
||||
qc.Config = @"{
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
|
||||
datasets: [{
|
||||
label: 'Users',
|
||||
data: [50, 60, 70, 180]
|
||||
}]
|
||||
}
|
||||
}";
|
||||
|
||||
qc.ToFile("/tmp/chart.png");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue