Sencha Charts Essentials by Ajit Kumar
Author:Ajit Kumar [Kumar, Ajit]
Language: eng
Format: epub
Tags: Web, Computers, Programming Languages, User Interfaces, JavaScript, Web Programming
ISBN: 9781785288487
Google: NaS_CQAAQBAJ
Publisher: Packt Publishing Ltd
Published: 2015-05-30T20:54:02+00:00
So, let's provide our own version of the provideLegendInfo method. Here is the implementation of the method which will be a member method of the SCE.series.MarketClock class:
provideLegendInfo: function (target) { var me = this, store = me.getStore(); if (store) { var items = store.getData().items, i, style; for (i = 0; i<items.length; i++) { style = me.getStyleByIndex(i); target.push({ name: items[i].get('market'), mark: style.fillStyle || 'black', disabled: false }); } } }
The AbstractChart class the preceding method by passing an empty array to it as an argument. We have used the formal parameter—target—for it. The method iterates the chart's store records and prepares the legend data for them. Legend data contains the name, mark, and disabled fields. The name field is set to the market name using the market field on the record. The mark field is set to the sector color. Once the legend data is created, it is added to the target array so that it is available to the AbstractChart logic, where it adds this data to its legendStore.
Refresh the application and you will see the neat legend displayed on the right-hand side of our market clock.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(25287)
Hello! Python by Anthony Briggs(24338)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(23432)
Kotlin in Action by Dmitry Jemerov(22511)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(21975)
Dependency Injection in .NET by Mark Seemann(21845)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(20711)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(19523)
Grails in Action by Glen Smith Peter Ledbrook(18605)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(17033)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(15843)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(13690)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(11853)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(11151)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10621)
Hit Refresh by Satya Nadella(9199)
The Kubernetes Operator Framework Book by Michael Dame(8570)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8400)
Robo-Advisor with Python by Aki Ranin(8360)