Home
Options

CreateXhtmlWriter with LINQPadChart - wrong output

var customers = new[]
{
    new { Name = "John", TotalOrders = 100 },
    new { Name = "Mary", TotalOrders = 130 },
    new { Name = "Sara", TotalOrders = 140 },
    new { Name = "Paul", TotalOrders = 125 },
};

LINQPadChart chart = customers.Chart(c => c.Name, c => c.TotalOrders); //.Dump();   // Don't forget to Dump it!

string fileName = $"{Path.GetFileName(Util.CurrentQueryPath)}.html";

using TextWriter htmlOut = Util.CreateXhtmlWriter(enableExpansions: true);

htmlOut.Write(customers);
htmlOut.Write(chart);

File.WriteAllText(fileName, htmlOut.ToString(), Encoding.UTF8);
fileName.Dump();

Hi All,
running this code gives me a chart tab in LINQPad instead of HTML output to the file.
Does anyone know why?

Comments

Sign In or Register to comment.