WebCanvas on WebContainer?

I’m drawing a gant chart.
At the moment I’m drawing rectangles with graphics commands onto the WebCanvas, something like this:

As I understand it the maximum dimension of the canvas are limited by the client browser and is represented as a bitmap image.
Sound a ‘bit’ clunky for what I want to do, but it’s working.

I have made other charts in the past by embedding WebContainers in Views.
It works and makes nice objects. However getting the bounding box of objects and not knowing if an object has been drawn out of bounds has led to some interesting effects in my application. I there are a lot of objects in the view it can take a long time to load.

Any other alternative implementations or optimizations you can think of?

Hi Brian,
We have developed something similar using a webControlWrapper and generating HTML to create tables to display the data:

We have 4 divs:

  1. Headings: This would be your ID, TaskName, Predecessors, Duration headings
  2. Calendar: This would be your Month and day of week headings
  3. TaskList: This would be your Tasks 1-10
  4. TableIn: This would be your red and blue areas

We generate the tables in each Div from the data and this determines the width and height of the TableIn Div. The width of TableIn would match the width of the Calendar div and the height of the TableIn div would match the height of the TaskList Div.

We only show scrollbars on the TableIn div and we then do some javascript to scroll the Calendar div left and right when TableIn scrolls left and right and we scroll TaskList up and down when TableIn scrolls up and down. So the Calendar and TaskList divs are always visible.

The whole thing displays very quickly and this works well even on an iPad although you won’t get momentum scrolling!

An alternative approach!

Thanks

Jim

[quote=324564:@Brian O’Brien]I’m drawing a gant chart.
At the moment I’m drawing rectangles with graphics commands onto the WebCanvas, something like this:

As I understand it the maximum dimension of the canvas are limited by the client browser and is represented as a bitmap image.
Sound a ‘bit’ clunky for what I want to do, but it’s working.

I have made other charts in the past by embedding WebContainers in Views.
It works and makes nice objects. However getting the bounding box of objects and not knowing if an object has been drawn out of bounds has led to some interesting effects in my application. I there are a lot of objects in the view it can take a long time to load.

Any other alternative implementations or optimizations you can think of?[/quote]
As for optimizations, webcanvas uses a diff algorithm to try to send as few instructions as possible to the browser for each paint event. So if paint 1 and paint 2 are identical, no instructions are sent.

Thinking of this it’s very important that the order of the instructions stay relatively the same.

It’s also worth noting that for very complex drawings, the diff engine can actually hurt drawing time. You might want to try turning it off to see if performance improves overall. It’s a property in the inspector.