Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit f42735c0 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

bugfix/workaround geherating plots: -1 is interpreted as 'invalid value' -...

bugfix/workaround geherating plots: -1 is interpreted as 'invalid value' - filter out all -1 values...
parent 0275896d
No related branches found
No related tags found
No related merge requests found
......@@ -112,8 +112,17 @@ namespace TUGraz.VectoCore.Tests.Utils
for (var i = 1; i <= yfields.Length; i++) {
var yfield = yfields[i - 1];
var y = modDataV3.Rows.Cast<DataRow>().Select(v => v.Field<string>(yfield.GetName())).ToArray();
var y2 = modDataV22.Rows.Cast<DataRow>().Select(v => v.Field<string>(yfield.GetName())).ToArray();
var y =
modDataV3.Rows.Cast<DataRow>()
.Select(v => v.Field<string>(yfield.GetName()))
.Select(v => v == "-1" ? "-1.00001" : v)
.ToArray();
//y = y.ToArray();
var y2 =
modDataV22.Rows.Cast<DataRow>()
.Select(v => v.Field<string>(yfield.GetName()))
.Select(v => v == "-1" ? "-1.00001" : v)
.ToArray();
var values = string.Format("{0}|{1}|{2}|{3}", string.Join(",", x), string.Join(",", y), string.Join(",", x2),
string.Join(",", y2));
......@@ -127,7 +136,8 @@ namespace TUGraz.VectoCore.Tests.Utils
values += string.Format("|{0}|{1}", string.Join(",", x), string.Join(",", y3));
}
values = values.Replace("NaN", "0");
values = values.Replace("NaN", "_");
//values = values.Replace("-1", "-1.00001");
if (values.Length > 14000) {
// remove all decimal places to reduce request size
values = Regex.Replace(values, @"(\.[0-9]).*?,", "$1,");
......@@ -146,6 +156,7 @@ namespace TUGraz.VectoCore.Tests.Utils
private static Stream CreateGraphStream(string xLabel, string yLabel, int xAxisRange, string values)
{
// see https://developers.google.com/chart/image/?hl=en for details
using (var client = new WebClient()) {
var response = client.UploadValues("https://chart.googleapis.com/chart", new NameValueCollection {
{ "cht", "lxy" },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment