Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: Ext.ux.chart.SmartLegend - Multi-column self adjusting Chart Legend

  1. #21
    Sencha - Ext JS Dev Team nohuhu's Avatar
    Join Date
    Jun 2011
    Location
    Redwood coast
    Posts
    386
    Vote Rating
    77
      1  

    Default

    Daniil,

    Is there any compelling reason to use prototype munging instead of the normal class inheritance model? I don't see any, and you shouldn't, too.

    Regards,
    Alex.
    Regards,
    Alex.

  2. #22
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    1,017
    Vote Rating
    125
      0  

    Default

    Hi @nohuhu,

    I think it is my bad habit, thank you for pointing that out.

    You meant that I should write something like this:
    Code:
    Ext.chart.Chart.override({
        initComponent: function() {
            this.callParent();
            this.legend = Ext.create('Ext.ux.chart.SmartLegend', {
                position: 'right',
                chart: this,
                rebuild: true,
                boxStrokeWidth: 1
            });
        }
    });
    or create a new class inheriting from Chart, right?
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Write C#. Run JavaScript! - Live | Twitter
    --------------------------------------------------

  3. #23
    Sencha - Ext JS Dev Team nohuhu's Avatar
    Join Date
    Jun 2011
    Location
    Redwood coast
    Posts
    386
    Vote Rating
    77
      1  

    Default

    @Daniil,

    Not exactly. To override a stock class, use Ext.define instead:

    PHP Code:
    Ext.define('MyOverrides.chart.Chart', {
        
    override'Ext.chart.Chart',
        ...
    }); 
    This will allow you to take advantage of the class system, dynamic loading and Sencha Cmd build process. However, the preferred way to reuse the code is class inheritance. See my Stackoverflow answer for more explanations.

    Regards,
    Alex.
    Regards,
    Alex.

  4. #24
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    1,017
    Vote Rating
    125
      0  

    Default

    Oh, I see the Ext.Base.override method is marked as deprecated. Thank you, Alex.

    Also thank you for the Stackoverflow link. It was worth to read!
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Write C#. Run JavaScript! - Live | Twitter
    --------------------------------------------------

  5. #25
    Sencha User
    Join Date
    Jun 2013
    Posts
    1
    Vote Rating
    0
      0  

    Default IE 11 issue for Smart LEgend

    Hi, I have implemented smart legend in ext.net mvc application this legend does not get rendered fine in IE 11.

    Any help would be gr8

    Please find the below image:

    snapshot.jpg

  6. #26
    Sencha Premium Member
    Join Date
    Aug 2012
    Location
    Pune, India
    Posts
    10
    Vote Rating
    0
      0  

    Question Compatibility with v5

    @nohuhu,

    Is this extension compatible only with v4.x and not v5?

    -Sridhar

  7. #27
    Sencha - Ext JS Dev Team nohuhu's Avatar
    Join Date
    Jun 2011
    Location
    Redwood coast
    Posts
    386
    Vote Rating
    77
      0  

    Default

    Sridhar,

    Honestly I never tried it with 5.x but theoretically it should work. There were not many changes to the legacy charts since 4.x days.

    Regards,
    Alex.
    Regards,
    Alex.

  8. #28
    Sencha User
    Join Date
    May 2016
    Posts
    1
    Vote Rating
    0
      0  

    Default Could I implement an inexpensive way to restrict number of legend items in a legend?

    Could I restrict the number of items in a legend, say to 8 ? Instead of the remaining items, I wish to show ellipsis (...) in its place.
    Could I use remove() to extract legend items from count 8 ahead and then manually add an item "..." using add()? Is there a specific part of my code where I should be doing this complete the change before the chart is rendered? Like in initComponent?
    I know its a dirty option, but that's what the client is asking for. Any help would be appreciated! Many thanks!

Page 3 of 3 FirstFirst 123

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •