+1-888-365-2779
Try Now
More in this section

Forums / 3.x Pre-release forums (retired) / Styling Poll Results

Styling Poll Results

5 posts, 0 answered
  1. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    23 Mar 2007
    Link to this post
    Hello -

    Perhaps I am missing something basic, but it seems I am a little limited in how I can style the graphical poll results. For example unless I create a new Template control the graph is limited to a set Height. Multiple polls appear squished or stretched.
    Another example would be custom colors for the resulting graph. Finally, is there a way to change the light gray graph background in the template?

    thanks for all of your help.

    Sincerely,

    Ben
  2. Imran
    Imran avatar
    75 posts
    Registered:
    17 Jan 2007
    23 Mar 2007
    Link to this post

    Hey

    I'm also working with the poll results. But as for styling the general look and feel of the poll I created my own CSS class and attached it to the cssClass property. Example:

    .PollSimple
    {
        width:130px;
        border:1px solid black;
        padding:5px;
        background-color:White;
    }

    .PollSimple h4
    {
        margin:0px 0px 8px 0px;
        padding:0px;
        font-size:13px;
        font-weight:bold;
    }

    .PollSimple h5
    {
        margin:0px 0px 8px 0px;
        padding:0px;
        font-size:10pt;
        font-weight:normal;
    }

    .PollSimple fieldset
    {
        border:0px;
    }

    .PollSimple span br
    {
        clear:both;
    }

    .PollSimple span label
    {
        float:left;
        margin:-2px 0px 5px 0px;
    }

    .PollSimple span input
    {
        width:20px;
        float:left;
        border:0px;
    }

    .PollSimple .button
    {
        background-color:Silver;
        margin:10px 0px 5px 20px;
        width:50px;
        height:20px;
    }

    .PollSimple .validator
    {
        font-size:smaller;
        color:Red;
    }

    But can anyone tell me how to adjust the size of the results bars? Or even colour them? Many thanks !

  3. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    23 Mar 2007
    Link to this post
    Hello Ben,

    First, you should make sure you are editing the right template. These templates are located in the ~/Common/Templates/Polls folder. Note that ResultsTemplate.ascx is used when the UseLegend of the ResultsBox is set to true.This means that the answers for each question will be shown in a single chart.
    The ResultsTemplateNoLegend.ascx is used when the UseLegend of the ResultsBox is set to false. This means that each answer will be shown in a separate chart.
    To see which template you should edit, go to edit the properties of the PollBox control. From the Misc category, click Edit for the ResultsBox. The properties for the ResultsBox appear right away. Again, under Misc, you should see the properties TemplateURL and UseLegend. The first one is used to set the path to the template from which you can adjust the chart.
    You should be very careful which template you use, as the charts are very different and editing the wrong template may result in stretching or squishing of the poll results.

    To set the bars height when the UseLegend property is set to true, you should add this property: 
    BarWidthPercent="80"

    If the UseLegend property is set to false, you should add this one: Height="26".

    To set the background color for the chart, you can do this from the template by adding this property to the chart tag: Background-MainColor="SomeColor"

    Let me know if you need any further assistance.

    Best wishes,
    Vassil Daskalov
    the telerik team

    Instantly find answers to your questions at the new telerik Support Center
  4. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    23 Mar 2007
    Link to this post
    Hello Imran,

    This just a quick follow-up.
    If you want each answer to be displayed in a different color, you need to set that through the administration. Go to Edit or Add a poll and in the Questions and Answers filed, you will see a chart color next to each answer.

    Greetings,
    Vassil Daskalov
    the telerik team

    Instantly find answers to your questions at the new telerik Support Center
  5. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    24 Mar 2007
    Link to this post
    Thanks I will give the BarWidthPercent a shot.
Register for webinar
5 posts, 0 answered