Group Abstract Group Abstract

Message Boards Message Boards

Use a function that creates a DateListPlot and works in TabView?

Posted 6 years ago
POSTED BY: Kyle MacLaury
7 Replies
Posted 6 years ago

Rohit and Henrik,

Thank you both! Your advice was quite helpful.

Here is where I ended.

databintoTimeSeries[databin_Databin] := 
 DateListPlot[
  TimeSeries@Map[{#["DATE"], #["KWH"]} &, Normal[Dataset[databin]]]]

TabView[Row[{Rasterize[
       Show[EntityValue[#, "image"], ImageSize -> {40, 40}], 
       Background -> None], #}] -> 
    databintoTimeSeries[EntityValue[#, "monthly bills"]] & /@ 
  EntityList["Campus Building"], ControlPlacement -> Left]

Everything outputs as expected now.

POSTED BY: Kyle MacLaury
Posted 6 years ago
POSTED BY: Rohit Namjoshi

Well, exactly this was the idea in my reply above: Doing it step by step!

  • create a list of images
  • create a list of DateListPlot
  • create the TabView

Then it most likely will become obvious where the problem is. Why is this so difficult?

POSTED BY: Henrik Schachner
Posted 6 years ago
POSTED BY: Kyle MacLaury
Posted 6 years ago

Hi Kyle,

What does this evaluate to?

campusBuldingMonthlyBills[#] & /@ EntityList["Campus Building"]
POSTED BY: Rohit Namjoshi
Posted 6 years ago

Thank you, Henrik. I played around with your idea a bit, but I’m still struggling. I think it has something to do with TabView. I tried this with another function that also works independently, but doesn’t work within the context of TabView.

POSTED BY: Kyle MacLaury

Kyle,

I cannot really try, because I do not have your data, but maybe when you write your code in a more "step by step" manner, I cannot see why things should not work, e.g.:

ri = ImageResize[#, {40, 40}] &@*ExampleData /@ {{"TestImage", "Girl"}, {"TestImage", 
     "Girl2"}, {"TestImage", "Girl3"}, {"TestImage", 
     "Lena"}, {"TestImage", "Tiffany"}, {"TestImage", "Mandrill"}};
data = Table[{DateObject@RandomInteger[{0, UnixTime[]}], RandomInteger[100]}, {r, 6}, {c, 10}];
dlpl = DateListPlot /@ data;
TabView[MapThread[Rule, {ri, dlpl}]]

enter image description here

BTW: Nice idea to use images as tab labels! Regards -- Henrik

POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard