Widget development

Viewpoint
Enthusiast

Widget development


1) could we include multiple sparkline widgets into one tab.

I tried ctx.addViewObject("spartkline1", ...) and ctx.addViewObject("sparkline2" ...); with different model name, but the first one is overrided.

2) do we have any widgets has x axis timestamp refine to hour/minutes?

I am working on 13.0.1, should the 13.1.1 include more example/domes or more documents on those questions?

thanks
30 REPLIES
Teradata Employee

Re: Widget development

Jian,

You can definitely include multiple sparkline widgets on the page. In the Widgetopia example included with the PDK, it shows you an example of using multiple sparklines on the same page. My guess however is that your problem lies in the value you are passing to the context attribute of the tag. If you have multiple sparklines on the page, you need to make sure each context attribute is unique to a particular sparkline. For example, you would do something similar to the following in your .jsp:




In regards to your second question, I don't quite understand what you are asking. Could you please rephrase the question?

Have a great day!
Teradata Employee

Re: Widget development

Apparently the forum strips out .xml style code... So for now, assume each line in this example has a opening and closing tag around it:

vp:sparklineWidget label="sparkline1Label" context="${context}Sparkline1" model="${sparkline1}" width="440" height="70"
vp:sparklineWidget label="sparkline2Label" context="${context}Sparkline2" model="${sparkline2}" width="440" height="70"
Enthusiast

Re: Widget development

thanks for the response, modify the jsp as following. the sparkline1 works well. But I encounter alert box when I select the sparkline2 and nothing show.









Enthusiast

Re: Widget development








Enthusiast

Re: Widget development

[vp:tabs id="${context}widgets" context="${context}"]
[vp:tab context="${context}sparkline1" label="sparkline1"]
[vp:sparklineWidget label="sparkline1" context="${context}sparkline1" model="${sparkline1}" width="800" height="100" /]
[/vp:tab]
[vp:tab context="${context}sparkline2" label="sparkline2"]
[vp:sparklineWidget context="${context}sparkline2" label="sparkline2" model="${sparkline2}" width="800" height="100" /]
[/vp:tab]
[/vp:tabs]
Enthusiast

Re: Widget development

For the second question, we are looking for some visual component showing x-asix in unit of minute/hour. the no idea how to do that in sparklineWidget or graphWidget. I understand the mouse hovering shows details (x/y asix info)
Teradata Employee

Re: Widget development

Can you post the error so I have a better idea of what the problem might be? If you are currently using FireFox, I recommend you install Firebug to help you debug. Firebug will usually help you narrow down errors that occur on your page. You can find it at http://getfirebug.com/

Currently we do not support x-axis display data when you use the tag for a sparkline. You can implement the sparkline manually with our sparkline javascript. If you are interested in going this route, I can walk you through how this can be done.
Enthusiast

Re: Widget development

thanks, Lewis. Yes. we need the sparkline javascript approach, I notice commonweb has lots of great figures that we want. Could you help me to go through that. Any sample portlet like Widgtopia will be wonderful.
Teradata Employee

Re: Widget development

I am working on getting an example up for you Jian. I will have it for you soon.