Jump to content

Customized histogram


OlavOhmark

Recommended Posts

Hello,

I have a signal (UAValue) that I want to present as a kind of histogram, but in a line diagram rather than a bar chart. The histogram should be based on a second signal (Power). I have created a standard histogram i Seeq like this (disregard from the monthly aggregation for the moment):

image.thumb.png.03989ef40e20fd7bb3525d1a1b8ab4d0.png

Each bin is 500 units wide.

The diagram I want to have looks like this (created in Power BI):

image.png.f276c4d86cb12579c21bfba449a57d0d.png

 

I have got as far as creating a signal (Power_I) where the values are rounded to nearest 500, but I'm stuck on how to create a signal where an average of UAValue is calculated for each value in Power_I. I also want to aggregate on year (or rather heating season, July to June) and add a reference curve.

What is the best approach to achieve this?

  • Like 1
Link to comment
Share on other sites

  • Seeq Team

Hi Olav,

There is a workaround in XY Plot but it may not able to plot exactly the same as your Power BI screenshot.

Step 1: Create the binning conditions using value search. As an example I created 4 conditions with bin size of 10.

image.png

 

Step 2: Create the condition for June and July

join(
months(Month.June, "Asia/Kuala_Lumpur"),
months(Month.July, "Asia/Kuala_Lumpur"),90d)

Step 3: Calculate the average value during each bin in June&July and combine them together. The move is to avoid overlap at the same startkey.

combinewith(
$t.within($b010).aggregate(average(),$june_july,startKey(),0s).move(1h),
$t.within($b102).aggregate(average(),$june_july,startKey(),0s).move(2h),
$t.within($b203).aggregate(average(),$june_july,startKey(),0s).move(3h),
$t.within($b304).aggregate(average(),$june_july,startKey(),0s).move(4h))

image.png

Step 4: Used the setproperty() to create the corresponding X value for each of the average value.

combinewith(
$t.within($b010).aggregate(average(),$step2,startKey(),0s).move(1h).toCapsules().setProperty('Bin',10),
$t.within($b102).aggregate(average(),$step2,startKey(),0s).move(2h).toCapsules().setProperty('Bin',20),
$t.within($b203).aggregate(average(),$step2,startKey(),0s).move(3h).toCapsules().setProperty('Bin',30),
$t.within($b304).aggregate(average(),$step2,startKey(),0s).move(4h).toCapsules().setProperty('Bin',40))
.toSignal('Bin',startKey()).toDiscrete()

image.png

Step 5: Switch to the XY Plot and expand the date range. Create the individual conditions for each year and you can then color based on these conditions.

image.png

Let me know first is this workaround suits you.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...