Displaying chart with dates

Stimulsoft Reports.WEB discussion
Post Reply
n.froeh
Posts: 17
Joined: Mon Oct 05, 2020 6:03 am

Displaying chart with dates

Post by n.froeh »

Hey there,

we're still experimenting with your report engine on .Net Core (Stimulsoft.Reports.Web.NetCore) and we got a question regarding displaying data in an clustered column chart.

We're retrieving json data with the following scheme:

Code: Select all

{
	"invoices":
	[
		{
			 "date": "2019-12-12T00:00:00.0000000Z",
			 "invoiceItems": 
			 [
			 	{
			 		"brutto": 200
			 	},
			 	{
			 		"brutto": 100
			 	},
			 	{
			 		"brutto": 300
			 	}
			 ]
		},
		...
	}
}
As an attachment i provided a sample report and sample data.

We also got two varying report variables: InvoicesDateFrom (e. g. "2019-01-01T00:00:00.0000000Z") and InvoicesDateTo (e. g. "2020-12-31T00:00:00.0000000Z").
Our desire is to create a chart with an x-axis from "InvoicesDateFrom" to "InvoicesDateTo" (in month steps), which displays the sum of the "brutto"-column of all invoices in the specific month.

I create a "Data from other DataSource"-Datasource, to group the data by month and display it in the chart.
Therefore i'm able to create a chart with every month that contains invoice data, but every other month that has no data is not displayed in the chart (march and december is missing).

Is there a way to define the DateTime-Range of the x-axis to minimum (InvoicesDateFrom) and maximum (InvoicesDateTo) and use a step of one month to display the whole year? So that march and december is shown with a value of 0?
I already checked properties like range on the x-axis and datetimestep (where only march but not december is displayed), but none of it seems to work for all cases.

Thank you for the help and have a nice day.
Attachments
testReport.mrt
(16.62 KiB) Downloaded 100 times
testdata.json
(2.64 KiB) Downloaded 102 times
Lech Kulikowski
Posts: 6265
Joined: Tue Mar 20, 2018 5:34 am

Re: Displaying chart with dates

Post by Lech Kulikowski »

Hello,

> Therefore i'm able to create a chart with every month that contains invoice data, but every other month that has no data is not displayed in the chart (march and december is missing).

In that case, you should modify your data to provide zero values for these months.

Thank you.
n.froeh
Posts: 17
Joined: Mon Oct 05, 2020 6:03 am

Re: Displaying chart with dates

Post by n.froeh »

Hello,

thank you for the fast answer.
Lech Kulikowski wrote: Thu Nov 05, 2020 1:45 pm Hello,

> Therefore i'm able to create a chart with every month that contains invoice data, but every other month that has no data is not displayed in the chart (march and december is missing).

In that case, you should modify your data to provide zero values for these months.

Thank you.
That's the exact problem, i got right now. I'm creating the datasource from another datasource and therefore can't provide zero values for these months within the designer, right?

If that's the case i got to change the retrieved data from the backend to the scheme in the attachment "testdata2.json". So i got data for every month.

But i'm still unable to create a graph which got the arguments from "invoicesdata.date" and the values of the grouped (by invoicesdata.date) sums of every invoiceItem.brutto for the specific month.
(and displaying empty months too)

Do you have an idea how i can achieve this with the data i provided (or which changes i have to make to the data)?

Thank you again and have a nice weekend!
Attachments
testReport2.mrt
(21.94 KiB) Downloaded 119 times
testdata2.json
(5.17 KiB) Downloaded 99 times
Lech Kulikowski
Posts: 6265
Joined: Tue Mar 20, 2018 5:34 am

Re: Displaying chart with dates

Post by Lech Kulikowski »

Hello,

In the report engine, it is not possible. You should modify your original data.

Thank you.
Post Reply