Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Ian Webster
c7d475576c Add test for Format and update readme 2021-09-21 08:20:41 -07:00
2 changed files with 45 additions and 15 deletions

View file

@ -59,5 +59,32 @@ namespace QuickChartTest
Assert.Contains("h=300", url); Assert.Contains("h=300", url);
Assert.Contains("key=abc123", url); Assert.Contains("key=abc123", url);
} }
[Fact]
public void TestWithFormat()
{
Chart qc = new Chart
{
Width = 500,
Height = 300,
Format = "svg",
Config = @"{
type: 'bar',
data: {
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
datasets: [{
label: 'Users',
data: [50, 60, 70, 180]
}]
}
}"
};
string url = qc.GetUrl();
Assert.Contains("https://quickchart.io:443/chart", url);
Assert.Contains("w=500", url);
Assert.Contains("h=300", url);
Assert.Contains("f=svg", url);
}
} }
} }

View file

@ -77,6 +77,9 @@ The background color of the chart. Any valid HTML color works. Defaults to #ffff
#### DevicePixelRatio: double #### DevicePixelRatio: double
The device pixel ratio of the chart. This will multiply the number of pixels by the value. This is usually used for retina displays. Defaults to 1.0. The device pixel ratio of the chart. This will multiply the number of pixels by the value. This is usually used for retina displays. Defaults to 1.0.
#### Format: string
The output format of the chart. Defaults to "png"
#### Key: string #### Key: string
API key (not required) API key (not required)