Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to retrieve the following from a bar chart using .Net SDK
(I am a newbie to QlikSense/.Net SDK. So I am not sure if this can be done through SDK or any other API).
I am able to read the data from bar chart. I've used the DataPages property in IBarChart interface to access the data points.
IEnumerable<ISheet> sheets = app.GetSheets();
foreach (ISheet sheet in sheets)
{
foreach (IBarchart child in sheet.Children.OfType<IBarchart>())
{
Console.WriteLine("{0} : {1} : {2} : {3} : {4}", sheet.MetaAttributes.Title, child.Info.Type, child.Info.Id, child.Title, child.Subtitle);
Console.WriteLine("The number of data points in the chart are " + child.DataPages.First().Matrix.Count()); //displays number of unit type bars in the chart
var barchartdata = child.DataPages.First().Matrix.ToDictionary(row => row.ElementAt(0).Text, row => row.ElementAt(1).Num);
foreach (var barchartrowitem in barchartdata)
{
Console.WriteLine(barchartrowitem.Key + ": " + barchartrowitem.Value); //displays the bar chart point name and value
}
}
I am able to read the data from bar chart. I've used the DataPages property in IBarChart interface to access the data points.
IEnumerable<ISheet> sheets = app.GetSheets();
foreach (ISheet sheet in sheets)
{
foreach (IBarchart child in sheet.Children.OfType<IBarchart>())
{
Console.WriteLine("{0} : {1} : {2} : {3} : {4}", sheet.MetaAttributes.Title, child.Info.Type, child.Info.Id, child.Title, child.Subtitle);
Console.WriteLine("The number of data points in the chart are " + child.DataPages.First().Matrix.Count()); //displays number of unit type bars in the chart
var barchartdata = child.DataPages.First().Matrix.ToDictionary(row => row.ElementAt(0).Text, row => row.ElementAt(1).Num);
foreach (var barchartrowitem in barchartdata)
{
Console.WriteLine(barchartrowitem.Key + ": " + barchartrowitem.Value); //displays the bar chart point name and value
}
}