This is a migrated thread and some comments may be shown as answers.

Combine Category+SubCategory in Bar Graph CategoryAxis text

6 Answers 205 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 04 Sep 2013, 10:58 PM
I've got a bar graph that is bound to the result of a query.
The query may be grouped by Category, or Category + SubCategory

The data is displayed visually correctly, however, I'm only able to display either the category OR the subcategory across the category axis.  
How can I A. display both, and B. wrap the text so that it will fit?

6 Answers, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 06 Sep 2013, 11:21 AM
Hi Stephen,

As I can understand you correctly you need a multiline text am I right? This feature is not supported by the Kendo Chart and there is no possible workaround. We will add it for the next official releases. So stay tuned. 

Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Accepted
Stephen
Top achievements
Rank 1
answered on 06 Sep 2013, 04:27 PM
Multiline text was one of the things I was after, but I can rotate 90deg to reduce this need for the moment.  What I really need is the ability to set the categoryAxis text to display both the category and subcategory.
I found a workaround.. which is to define multiple category axis. 
categoryAxis:
[{
   field: cPrimaryCat,
    labels: [{
        rotation: 90
    }
}, {
   field: cSecondaryCat,
    labels: [{
        rotation: 90
    }
}],
or
$categoryAxisA->field(cPrimaryCat),
          ->labels(array('rotation' => -90));
$categoryAxisB->field(cSecondaryCat),
          ->labels(array('rotation' => -90));
chart->addCategoryAxisItem($categoryAxisA)
    ->addCategoryAxisItem($categoryAxisB)
0
Maksim
Top achievements
Rank 1
answered on 15 Jan 2015, 12:00 PM
hi, we have same problem

we use categoryAxis.labels.template to render categories bold

# if (dataItem.is_category) { # <tspan style="font-weight: bold">  # } # #=value#  # if (dataItem.is_category) { # </tspan> # } #
 - it is ugly
 - we can't export it to image: chart.svg() generates non-valid svg

 - are there any valid method to make some categories (groups) bold or italic?
 - are there another method to group categories and subcategories along category axis?
0
T. Tsonev
Telerik team
answered on 19 Jan 2015, 08:45 AM
Hello,

There's no better option at the moment, but we hope this will change with the next major release.
We plan to add "visual templates" that will allow you to override the rendering of many chart elements, including labels.

The visual templates are free-form functions that employ the Drawing API to produce the visual elements.
These elements are live, in the sense that they can be updated later on and will fire events.

Thank you for your patience.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Maksim
Top achievements
Rank 1
answered on 19 Jan 2015, 12:09 PM
Hi, I'd like to share one thing.
We use chart.svg() result to convert it to .png image via librsvg
Sometimes it output blank image, in some other cases it produces normal png image.
I've found cause
<clipPath id='8d869faf-02fb-44e9-aeff-246cb3a8ff71'>
sometimes id starts with digit, other time with letter
id value cannot be uuid (xml id attribute value must be xml name - can't start width digit, see http://www.w3.org/TR/xml/#sec-attribute-types)
I've removed id's from svg completely, it solved my problem (empty image when pass svg to png via rsvg or imagemagick)
Could you please review and fix this?
0
T. Tsonev
Telerik team
answered on 21 Jan 2015, 02:15 PM
Hello,

Thanks for the heads-up. We'll rework the code to use safe IDs.

I've updated our Telerik points as a token of gratitude for your involvement.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Stephen
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Stephen
Top achievements
Rank 1
Maksim
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or