mick
breed
Huskysize
Smallage
4 mthsMeet Mick,a lovable,smart little fella.He is described by his foster Family as intelligent, playful,energetic and a fast learner.He loves to show off his high-five skills and is very food-motivated so will learn new tricks easily.


If you or your organization uses Python Pattern Matching, please consider financial support:
Give to Python Pattern Matching


Tarun Kumar Banerjee has done his M.Sc. from Kolkata University and PGDCA from Punjab University.
He belongs to Hooghly District. Of West Bengal .He is an educator, management consultant, senior corporate trainer, motivational speaker, and a first generation entrepreneur. He is associated with various International and National Organizations of Govt. of India ,Govt of HP, Punjab, Haryana, Various Universities ,IIT ,schools and colleges and also member of various professional organizations . He has conducted training programs for more than one hundred organizations namely L & T ,Godrej, Hero group,Vardhaman, Empire Packaging, Maruti ,Bata, Colgate,Indian oil, National Productivity council, Nittttr, Ministry of finance, Ministry of Environment and Forest, CRRID,RICM,VERKA,BBMB,KRIBHCO,CSIO,ISTC,NIPER,MAGSIPA,HIPA,SJVN,Jan siksha sansthan,Ark industries ,Mahindra and Mahindra etc He is empanelled as a corporate trainer for Panjab university. kolkata university, Punjab enginering college ,Chandigarh college of engineering and technology, Swami Vivekanand college, Sachdeva group of colleges. He was instrumental in various MOUs between academic institutions and Corporates. He participates in curriculum development workshops in Academic institutions like NIELIT ,NCERT etc. He has published various papers and articles in Journals and magazines. On the lighter side he has also played Badminton at National level.
Birthday: 8/7/1993
Phone: +0000 000 00
Email<EMAIL_ADDRESS>Website: www.tarun.com
Address: FLAT NO 240-C SECTOR 51-A CHANDIGARH
A. Personality Development
B. TQM/5S
C. Communication Skills
D. CV/Resume/ Interview Skills
E. Time Management
F. Team Building
G. Leadership Skills & Development H. Stress Management I. Marketing Skills J. Goal Setting K. Problem Solving L. Emotional Intelligence M. Conflict Management
N. Train The Trainer O. Relationship Management P. Customer Service Skills Q. Six Sigma R. Interpersonal Skills S. Business Communication T. Reading Skills
U. Writing Skills V. Listening Skills W. Campus to Corporate X. Business Etiquettes Y. Strategy Tools /Decision Making Z. Creative Technique/Learning Skills/Career Skills


A class for performing SNMP V2 queries on Cisco devices
| copyright | Copyright (c) 2012 - 2013, Open Source Solutions Limited, Dublin, Ireland |
|---|---|
| author | Barry O'Donovan |
getSNMP() : \OSS_SNMP\SNMP
| inherited_from | \OSS_SNMP\MIB::getSNMP() |
|---|---|
| inherited_from | \OSS_SNMP\MIBS\Cisco::getSNMP() |
\OSS_SNMP\SNMP
Instance of the SNMP objectinstances(string $name) : array
This is a hack on the remainingHopCount() as the MIB of this is empty on my test box (.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.1.1)
We name the instances as well based on the region name / use specified string.
string
If null, then instances are named using the MST region name. Else this is the root of the name.
array
The running MST instancesmaxInstanceId() : string
"The maximum MST (Multiple Spanning Tree) instance id, that can be supported by the device for IEEE MST"
string
The maximum MST instance IDmaxInstances() : string
"The maximum number of MST instances that can be supported by the device for IEEE MST"
string
The maximum number of MST instancesregionRevision() : string
string
The operational SMST region revisionremainingHopCount() : array
"The remaining hop count for this MST instance. If this object value is not applicable on an MST instance, then the value retrieved for this object for that MST instance will be -1.
This object is only instantiated when the object value of stpxSpanningTreeType is mst(4)."
array
The remaining hop count for all MST instancessetSNMP(\OSS_SNMP\SNMP $snmp) : \OSS_SNMP\MIB
| inherited_from | \OSS_SNMP\MIB::setSNMP() |
|---|---|
| inherited_from | \OSS_SNMP\MIBS\Cisco::setSNMP() |
\OSS_SNMP\MIB
An instance of this class for fluent interfaces$_snmp
| inherited_from | \OSS_SNMP\MIB::$$_snmp |
|---|---|
| inherited_from | \OSS_SNMP\MIBS\Cisco::$$_snmp |
OID_STP_X_SMST_MAX_INSTANCES
OID_STP_X_SMST_MAX_INSTANCE_ID
OID_STP_X_SMST_REGION_REVISION
OID_STP_X_SMST_REMAINING_HOP_COUNT


genes transcription expression flowering stage factor vernalization cell gene analysis Plant phase plant different protein factors expressed file pathways family involved data development floral identified Arabidopsis subcluster__, DEGs showed regulation response stages time (Fig. flower network Additional BH_DON developmental growth including vernalization; Wang related signal using {border-style Zhang vegetative Figure associated heading modules processes px;} sequencing #ffffff;} stages. transcriptome V_DON biological families hormone sampling Furthermore, RNA Sci WRKY orchardgrass reproductive stress VG_DON circadian functional wall (c_g), Biol H_DON VRN metabolic molecular samples shows signaling subcluster__ transduction Huang KEGG LINK RNA-seq clusters enriched formation kb) key low module, regulators significantly specific Cell Vernalization addition, bud important proteins represents role study (Additional BMC WRKY, acid clustering consistent critical information number play process, regulatory used NAC cold contained defined distinct function highly organ pathway process relative results similar sucrose temperature transduction, unigenes ./s--- FLC Genes MADS-box Physiol Science WGCNA candidate changes control cytochrome genes, high metabolism, multiple perennial phases previous processes, px; qRT-PCR revealed signaling, total {font-family AP/EREBP AV, AV_DON BH, BV, Chen Fig. Flowering IAA, Kim Subcluster__ TFs VG, activity, auxin biosynthesis categories coexpression complex correlation database follows: font-size genetic growth; heading; inflorescence labels major mechanisms metabolism module morphological pairwise performed photoperiod stage, stages, starch terms transcriptional variety vernalization, wheat (TIFF ABI/VP Amasino FPKM Liu MYB Mol Sample Table abiotic base based carbohydrate controlling demonstrated development. differentiation double; down-regulated encoding enrichment flowering. formation. genes. heading. higher identification identify initiation leaf levels light peak plants provide regulator sequence temporal transition upstream various young ./--- ./tpc.. ABA ARF CCAAT Dactylis FLOWERING Hsp Kit L.) LOCUS Lee National Research SPL Trends V_DON. Zhao according assembled available binding binding, biosynthetic border-color border-width category change clock cluster, data. development, domain-containing environmental ethylene evidence example, finger flowering-related generated glomerata heat hierarchical included induced length map morphogenesis overrepresentation phases, phosphorylation, photosynthesis provided reads regulate regulation. research roles solid; species stage. stem suggested suggesting temperatures thaliana timing vernalization. y-axis {font-style {font-weight (P), AUX/IAA AUXIN Acad BH_DON. BV_DON DEGs. DON DONATA FRI Gene Genomics H_DON, H_DON. Identification Natl Otherwise, Proc RESPONSE Res Thaliana USA). VRN, Xinquan Yan Zheng abundance abundant active activity affect analysis. article bHLH bHLH, basis biosynthesis, bold booting brown cellulose central chromosome cluster component comprehensive conditions constructed containing contains courier; crown days division elongation em; encode encoded expression. family, following functions groups growth, highlighted indicate indicated jasmonic large level lipid long macromolecule mainly manuscript. mediated meristem modules, motifs natural networks numerous online oxidation-reduction package participate pathway, pattern patterns peaks phases. phenylpropanoid phosphorylation processes. profiling proteins, pseudo-response pt;} quantitative real-time red reference regulated regulating relevant replicates reported responses, responsive result sample shoot study, subclusters supplementary trait transcripts type up-regulated weighted x-axis


We redefine content!
- harness enterprise content
- disintermediate visionary e-markets
- cultivate sticky platforms
- grow seamless supply-chains
- seize visionary e-services
- envisioneer end-to-end systems
- cultivate cross-media supply-chains
- productize frictionless schemas
- engineer visionary web-readiness
- incubate intuitive platforms
- iterate sexy niches
- brand integrated channels
- drive proactive methodologies


| (A) | ---- no text ---- | |
| 343 | (C) | These messengeres sente fortħ . to þe cyte ȝode |
| 344 | (D) | ¶ Thes sondis-men forth sent to þe Cite went |
| 345 | (E) | ¶ The messagers were foorth sent . & to cyte wente |
| (Ex) | ---- no text ---- | |
| 353 | (L) | þis sondismen sadly to þe cite ȝede |
| 338 | (P) | þese sonedismenn on a sopp to þe Cite wenten |
| 338 | (U) | ¶ This sondeours sent fortħ / to the Cite yede |
| (V) | ---- no text ---- |


#include <tinyxml.h>
Inheritance diagram for TiXmlElement:
Public Member Functions | |
| TiXmlElement (const char *in_value) | |
| Construct an element. | |
| TiXmlElement (const std::string &_value) | |
| std::string constructor. | |
| const char * | Attribute (const char *name) const |
| Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. | |
| const char * | Attribute (const char *name, int *i) const |
| Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. | |
| const char * | Attribute (const char *name, double *d) const |
| Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. | |
| int | QueryIntAttribute (const char *name, int *_value) const |
| QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer error checking. | |
| int | QueryDoubleAttribute (const char *name, double *_value) const |
| QueryDoubleAttribute examines the attribute - see QueryIntAttribute(). | |
| int | QueryFloatAttribute (const char *name, float *_value) const |
| QueryFloatAttribute examines the attribute - see QueryIntAttribute(). | |
| void | SetAttribute (const char *name, const char *_value) |
| Sets an attribute of name to a given value. | |
| void | SetAttribute (const std::string &name, const std::string &_value) |
| STL std::string form. STL std::string form. | |
| void | SetAttribute (const char *name, int value) |
| Sets an attribute of name to a given value. | |
| void | SetDoubleAttribute (const char *name, double value) |
| Sets an attribute of name to a given value. | |
| void | RemoveAttribute (const char *name) |
| Deletes an attribute with the given name. | |
| void | RemoveAttribute (const std::string &name) |
| STL std::string form. | |
| const TiXmlAttribute * | FirstAttribute () const |
| Access the first attribute in this element. | |
| const TiXmlAttribute * | LastAttribute () const |
| Access the last attribute in this element. | |
| const char * | GetText () const |
| Convenience function for easy access to the text inside an element. | |
| virtual TiXmlNode * | Clone () const |
| Creates a new Element and returns it - the returned element is a copy. | |
| virtual void | Print (FILE *cfile, int depth) const |
| All TinyXml classes can print themselves to a filestream. | |
| virtual const TiXmlElement * | ToElement () const |
| Cast to a more defined type. Will return null not of the requested type. | |
| virtual TiXmlElement * | ToElement () |
| Cast to a more defined type. Will return null not of the requested type. |
It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes.
|
|
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. If the attribute exists and can be converted to an double, the double value will be put in the return 'd', if 'd' is non-null. |
|
|
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. If the attribute exists and can be converted to an integer, the integer value will be put in the return 'i', if 'i' is non-null. |
|
|
Convenience function for easy access to the text inside an element. Although easy and concise, GetText() is limited compared to getting the TiXmlText child and accessing it directly. If the first child of 'this' is a TiXmlText, the GetText() returns the character string of the Text node, else null is returned. This is a convenient method for getting the text of simple contained text: <foo>This is text</foo> const char* str = fooElement->GetText(); 'str' will be a pointer to "This is text". Note that this function can be misleading. If the element foo was created from this XML: <foo>This is text</foo> then the value of str would be null. The first child node isn't a text node, it is another element. From this XML: <foo>This is text</foo> WARNING: GetText() accesses a child node - don't become confused with the similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are safe type casts on the referenced node. |
|
|
All TinyXml classes can print themselves to a filestream. This is a formatted print, and will insert tabs and newlines. (For an unformatted stream, use the << operator.) Implements TiXmlBase. |
|
|
QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer error checking. If the attribute is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE. If the attribute does not exist, then TIXML_NO_ATTRIBUTE is returned. |
|
|
Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does. |
|
|
Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does. |
|
|
Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does. |


GSoC Progress - Week 3 and 4
Programming · GSoC · SymPyHello, this post contains the third report of my GSoC progress. At one point, I had changed the deadline from Sundays to Fridays, but I seem to be running a week late on the post names. That has been corrected now
Progress
We decided to replace mpz_class
with piranha::integer
for coefficients and std::unordered_map
with piranha::hash_set
for the container. We got the lower-level working with this data-structure in the last week.
We decided to depend on Piranha
for the Polynomial
else our module won't be upto the speed we expect it to.
In future, we can write our hashtable and Integer as and when needed.
Report
The benchmarks results are:
expand2b
has:
Average: 108.2ms
Maximum: 114ms
Minimum: 107ms
while the latest expand2d
has:
Average: 23ms
Maximum: 23ms
Minimum: 23ms
which is a nice 4-5x speed-up.
The code for this(experimental) can be found in 470.
A more detailed report can be found here.
I also sent in a minor PR with some clean-ups that I felt neccessary in 472.
Targets for Week 5
- Wrap the the lower level into a
Polynomial
class. - Have the functionality of atleast the
UnivariatePolynomial
class. - Explore what kind of coefficients can be passed, since we have
piranha::integer
we need to think of havingrational
andsymbolic
coefficients now itself. - Think of various areas where
Polynomial
class needs to integrate in SymEngine for exampleexpand()
That's all this week.
Vaarwel


chart
alignTicks
to false.
If the grid lines look messy, it's a good idea to hide them for the
secondary axis by setting gridLineWidth
to 0.
Set the overall animation for all chart updating. Animation can be disabled throughout the chart by setting it to false here. It can be overridden for each individual API method as a function parameter. The only animation not affected by this option is the initial series animation, see plotOptions.series => animation.
The animation can either be set as a boolean or a configuration object. If true
,
it will use the 'swing' jQuery easing and a duration of 500 ms. If used as a configuration object,
the following properties are supported:
- duration
- The duration of the animation in milliseconds.
- easing
- When using jQuery as the general framework, the easing can be set to
linear
orswing
. More easing functions are available with the use of jQuery plug-ins, most notably the jQuery UI suite. See the jQuery docs. When using MooTools as the general framework, use the property nametransition
instead ofeasing
.
div
, allowing unique CSS styling
for each chart.
The margin between the outer edge of the chart and the plot area. The numbers in
the array designate top, right, bottom and left respectively. Use the options
marginTop
, marginRight
, marginBottom
and
marginLeft
for shorthand setting of one option.
Since version 2.1, the margin is 0 by default. The actual space is dynamically calculated
from the offset of axis labels, axis title, title, subtitle and legend in addition
to the spacingTop
, spacingRight
, spacingBottom
and
spacingLeft
options.
spacingTop
.
spacingRight
.
spacingBottom
.
spacingLeft
.
zoomType
option is set,
panning is disabled.
The space between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).
The space between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).
The space between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).
The space between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).
div
. Note that since the default
font styles are applied in the renderer, it is ignorant of the individual chart
options and must be set globally. Defaults
to:
style: { fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif', // default font fontSize: '12px' }
x
, y
or xy
.
chart.events
addSeries
method. The this
keyword refers to the
chart object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts. Through event.options
you can access the series options that was passed to the addSeries
method. Returning false prevents the series from being added.
Fires when clicking on the plot background. The this
keyword refers to the
chart object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts.
Information on the clicked spot can be found through event.xAxis
and
event.yAxis
, which are arrays containing the axes of each dimension
and each axis' value at the clicked spot. The primary axes are event.xAxis[0]
and event.yAxis[0]
. Remember the unit of a datetime axis is milliseconds
since 1970-01-01 00:00:00.
click: function(e) { console.log( Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', e.xAxis[0].value), e.yAxis[0].value ) }
Fires when the chart is finished loading. The this
keyword refers to the
chart object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts.
From version 2.0.4, there is also a second parameter to Highcharts.Chart
where a callback function can be passed to be executed on chart.load.
redraw
option set to true.
The this
keyword refers to the
chart object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts.
Fires when an area of the chart has been selected. Selection is enabled by setting
the chart's zoomType. The this
keyword refers to the
chart object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts. The default action for the
selection event is to zoom the
chart to the selected area. It can be prevented by calling
event.preventDefault()
.
Information on the selected area can be found through event.xAxis
and
event.yAxis
, which are arrays containing the axes of each dimension
and each axis' min and max values. The primary axes are event.xAxis[0]
and event.yAxis[0]
. Remember the unit of a datetime axis is milliseconds
since 1970-01-01 00:00:00.
selection: function(event) { // log the min and max of the primary, datetime x-axis console.log( Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', event.xAxis[0].min), Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', event.xAxis[0].max) ); // log the min and max of the y axis console.log(event.yAxis[0].min, event.yAxis[0].max); }
title
align
,
x
and y
for text alignment. Defaults to:
{ color: '#3E576F', fontSize: '16px' }
subtitle
position: "absolute"
and
left and top properties. Defaults to:
{ color: '#3E576F' }
xAxis
The X axis or category axis. Normally this is the horizontal axis, though if the chart is inverted this is the vertical axis. In case of multiple axes, the xAxis node is an array of configuration objects.
See the Axis object for programmatic access to the axis.
{ second: '%H:%M:%S', minute: '%H:%M', hour: '%H:%M', day: '%e. %b', week: '%e. %b', month: '%b \'%y', year: '%Y' }
maxPadding
option to control the axis end.
chart.get()
.
null
, the max value is
automatically calculated. If the endOnTick
option is
true, the max
value might be rounded up.
The actual maximum value is also influenced by
chart.alignTicks.
max
option is set or a max extreme is set using axis.setExtremes()
,
the maxPadding will be ignored.
minRange
instead.
null
the min value is
automatically calculated. If the startOnTick
option is
true, the min
value might be rounded down.
"auto"
,
the minor tick interval is calculated as a fifth of the tickInterval. If
null
, minor ticks are not shown.
inside
and outside
.
min
option is set or a min extreme is set using axis.setExtremes()
,
the minPadding will be ignored.
The minimum range to display. The entire axis will not be allowed to span over a smaller interval than this. For example, for a datetime axis the main unit is milliseconds. If minRange is set to 3600000, you can't zoom in more than to one hour.
min
or max
.
For example, to show the latest month, a range
of one month can be set.
maxPadding
option to control the axis start.
null
, the tick interval
is computed to approximately follow the tickPixelInterval on linear and datetime axes.
On categorized axes, a null
tickInterval will default to 1, one category.
Note that datetime axes are based on milliseconds, so for
example an interval of one day is expressed as 24 * 3600 * 1000
.
null
this option sets the approximate pixel interval of the
tick marks. Not applicable to categorized axis. Defaults to 72
for the Y axis and 100
for the X axis.
inside
and outside
.
tickPositioner
min
and max
of the axis are passed in as the first
and second parameter. Options like tickInterval
can be accessed by
this.options.tickInterval
. Note that in stock charts, the last label is hidden by
default by the showLastLabel
option.
xAxis.events
.setExtremes()
method or by selecting an area in the chart. The this
keyword refers to the axis object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on which
library is used as the base for Highcharts. The new user set minimum and maximum values
can be found by event.min
and event.max
.
xAxis.labels
"left"
,
"center"
or "right"
.
this.value
. Defaults to:
function() { return this.value; }
style: { color: '#6D869F', fontWeight: 'bold' }
xAxis.plotBands
click
,
mouseover
, mouseout
, mousemove
.
xAxis.plotBands.label
align
determines
where the texts anchor point is placed within the plot band, textAlign
determines
how the text is aligned against its anchor point. Possible values are
"left", "center" and "right". Defaults to the same as
the align
option.
xAxis.plotLines
click
,
mouseover
, mouseout
, mousemove
.
xAxis.plotLines.label
align
determines
where the texts anchor point is placed within the plot band, textAlign
determines
how the text is aligned against its anchor point. Possible values are
"left", "center" and "right". Defaults to the same as
the align
option.
xAxis.title
style: { color: '#6D869F', fontWeight: 'bold' }
yAxis
Extends xAxis
The Y axis or value axis. In case of multiple axes, the yAxis node is an array of configuration objects.
See the Axis object for programmatic access to the axis.
maxPadding
option to control the axis end.
max
option is set or a max extreme is set using axis.setExtremes()
,
the maxPadding will be ignored.
min
option is set or a min extreme is set using axis.setExtremes()
,
the minPadding will be ignored.
maxPadding
option to control the axis start.
yAxis.events
Extends xAxis.events
yAxis.labels
Extends xAxis.labels
"left"
,
"center"
or "right"
.
yAxis.title
Extends xAxis.title
yAxis.plotBands
Extends xAxis.plotBands
plotOptions
The plotOptions is a wrapper object for config objects for each series type. The config objects for each series can also be overridden for each series item as given in the series array.
Configuration options for the series are given in three levels. Options for all series in a chart are given in the plotOptions.series object. Then options for all series of a specific type are given in the plotOptions of that type, for example plotOptions.line. Next, options for one single series are given in the series array.
plotOptions.series
General options for all series types.
- duration
- The duration of the animation in milliseconds.
- easing
- When using jQuery as the general framework, the easing can be set to
linear
orswing
. More easing functions are available with the use of jQuery plug-ins, most notably the jQuery UI suite. See the jQuery docs. When using MooToos as the general framework, use the property nametransition
instead ofeasing
.
options.colors
array.
compare
is set to "percent"
or "value"
. When this is applied to multiple series, it allows comparing the development
of the series against eachother.
line
, spline
, area
and scatter
in
case it has a lineWidth
. The value for the dashStyle
include:
- Solid
- ShortDash
- ShortDot
- ShortDashDot
- ShortDashDotDot
- Dot
- Dash
- LongDash
- DashDot
- LongDashDot
- LongDashDotDot
Defines when to display a gap in the graph. A gap size of 5 means that if the distance between two points is greater than five times that of the two closest points, the graph will be broken.
In practice, this option is most often used to visualize gaps in time series. In a stock chart, intraday data is available for daytime hours, while gaps will appear in nights and weekends.
chart.get()
.
Date.UTC(2011, 0, 1)
.
If no x values are given for the points in a series, pointInterval defines
the interval of the x values. For example, if a series contains one value
each day, set pointInterval to 24 * 3600 * 1000
.
showCheckbox
is true,
the checkbox next to the series name in the legend will be checked for a selected series.
selected
option.
mouseOut
event
on a series isn't triggered until the mouse moves over another series, or out
of the plot area. When false, the mouseOut
event on a series is
triggered when the mouse leaves the area around the series' graph or markers.
This also implies the tooltip when not shared. When stickyTracking
is false, the
tooltip will be hidden when moving the mouse between series.
headerFormat
, pointFormat
,
yDecimals
, xDateFormat
, yPrefix
and ySuffix
.
plotOptions.series.marker
null
, the series' or point's color
is used.
null
, the series' or point's color
is used.
plotOptions.series.point
plotOptions.series.point.events
this
keyword refers to the
point object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts.
If the series.allowPointSelect
option is true, the default action for the point's click event is to toggle the
point's select state. Returning false
cansels this action.
this
keyword refers to the
point object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts.
this
keyword refers to the
point object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts.
.remove()
method. The this
keyword refers to the
point object itself. One parameter, event
, is passed to the function.
Returning false
cancels the operation.
this
keyword refers to the
point object itself. One parameter, event
, is passed to the function.
Returning false
cancels the operation.
this
keyword refers to the
point object itself. One parameter, event
, is passed to the function.
Returning false
cancels the operation.
.update()
method. The this
keyword refers to the
point object itself. One parameter, event
, is passed to the function. The
new point options can be accessed through event.options
.
Returning false
cancels the operation.
plotOptions.series.marker.states
plotOptions.series.marker.states.hover
null
, the series' or point's color
is used.
null
, the series' or point's color
is used.
plotOptions.series.marker.states.select
series.allowPointSelect
option to true.
null
, the series' or point's color
is used.
null
, the series' or point's color
is used.
plotOptions.series.dataGrouping
The method of approximation inside a group. When for example 30 days are grouped into one month, this determines what value should represent the group. Possible values are "average", "open", "high", "low", "close" and "sum". For OHLC and candlestick series the approximation is "ohlc" by default, which finds the open, high, low and close values within all the grouped data.
Custom aggregate methods
can be added by assigning a callback function as the approximation. This function takes
a numeric array as the argument and should return a single numeric value or null
. Note that
the numeric array will never contain null values, only true numbers. Instead, if null
values are present in the raw data, the numeric array will have an .hasNulls
property set to true
. For single-value data sets the data is available in the first
argument of the callback function. For OHLC data sets, all the open values are in the first
argument, all high values in the second etc.
units: [[ 'millisecond', // unit name [1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples ], [ 'second', [1, 2, 5, 10, 15, 30] ], [ 'minute', [1, 2, 5, 10, 15, 30] ], [ 'hour', [1, 2, 3, 4, 6, 8, 12] ], [ 'day', [1] ], [ 'week', [1] ], [ 'month', [1, 3, 6] ], [ 'year', null ]]
plotOptions.series.dataLabels
Extends xAxis.labels
this.percentage |
Stacked series and pies only. The point's percentage of the total. |
this.point |
The point object. The point name, if defined, is available
through this.point.name . |
this.series : |
The series object. The series name is available
through this.series.name . |
this.total |
Stacked series only. The total value at this point's x value. |
this.x : |
The y value. |
this.y : |
The y value. |
formatter: function() { return this.y; }
plotOptions.series.events
this
keyword refers to the
series object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts. Additionally, event.point
holds a pointer to the nearest point on the graph.
this
keyword refers to the
series object itself. One parameter, event
, is passed to the function.
The state of the checkbox is found by event.checked
. Return false
to prevent the default action which is to toggle the select state of the series.
.hide()
.
this
keyword refers to the
series object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts. The default action is to toggle
the visibility of the series. This can be prevented by returning false
or calling event.preventDefault()
.
this
keyword refers to the
series object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts.
this
keyword refers to the
series object itself. One parameter, event
, is passed to the function.
This contains common event information based on jQuery or MooTools depending on
which library is used as the base for Highcharts. If the
stickyTracking option is true,
mouseOut
doesn't happen before the mouse enters another graph or leaves
the plot area.
.show()
.
plotOptions.series.states
plotOptions.series.states.hover
plotOptions.series.states.hover.marker
Extends plotOptions.series.marker
plotOptions.line
Extends plotOptions.series
plotOptions.line.marker
Extends plotOptions.series.marker
plotOptions.line.marker.states
Extends plotOptions.series.marker.states
plotOptions.line.marker.states.hover
Extends plotOptions.series.marker.states.hover
plotOptions.line.marker.states.select
Extends plotOptions.series.marker.states.select
plotOptions.line.dataGrouping
Extends plotOptions.series.dataGrouping
plotOptions.line.dataLabels
Extends plotOptions.series.dataLabels
plotOptions.line.events
Extends plotOptions.series.events
plotOptions.line.point
Extends plotOptions.series.point
plotOptions.line.point.events
Extends plotOptions.series.point.events
plotOptions.line.states
Extends plotOptions.series.states
plotOptions.line.states.hover
Extends plotOptions.series.states.hover
plotOptions.line.states.hover.marker
Extends plotOptions.series.states.hover.marker
plotOptions.spline
Extends plotOptions.series
plotOptions.spline.marker
Extends plotOptions.series.marker
plotOptions.spline.marker.states
Extends plotOptions.series.marker.states
plotOptions.spline.marker.states.hover
Extends plotOptions.series.marker.states.hover
plotOptions.spline.marker.states.select
Extends plotOptions.series.marker.states.select
plotOptions.spline.dataGrouping
Extends plotOptions.series.dataGrouping
plotOptions.spline.dataLabels
Extends plotOptions.series.dataLabels
plotOptions.spline.events
Extends plotOptions.series.events
plotOptions.spline.point
Extends plotOptions.series.point
plotOptions.spline.point.events
Extends plotOptions.series.point.events
plotOptions.spline.states
Extends plotOptions.series.states
plotOptions.spline.states.hover
Extends plotOptions.series.states.hover
plotOptions.spline.states.hover.marker
Extends plotOptions.series.states.hover.marker
plotOptions.scatter
Extends plotOptions.series
headerFormat
, pointFormat
,
yDecimals
, xDateFormat
, yPrefix
and ySuffix
.
Unlike other series, in a scatter plot the series.name by default shows in the headerFormat
and poin.x and point.y in the pointFormat.
plotOptions.scatter.marker
Extends plotOptions.series.marker
plotOptions.scatter.marker.states
Extends plotOptions.series.marker.states
plotOptions.scatter.marker.states.hover
Extends plotOptions.series.marker.states.hover
plotOptions.scatter.marker.states.select
Extends plotOptions.series.marker.states.select
plotOptions.scatter.dataLabels
plotOptions.scatter.dataLabels
Extends plotOptions.series.dataLabels
plotOptions.scatter.events
Extends plotOptions.series.events
plotOptions.scatter.point
Extends plotOptions.series.point
plotOptions.scatter.point.events
Extends plotOptions.series.point.events
plotOptions.scatter.states
Extends plotOptions.series.states
plotOptions.scatter.states.hover
Extends plotOptions.series.states.hover
plotOptions.scatter.states.hover.marker
Extends plotOptions.series.states.hover.marker
plotOptions.area
Extends plotOptions.series
null
, the series' color
is
used with the series' fillOpacity
.
color
of the series, but the lineColor setting allows setting a separate
color for the line without altering the fillColor
.
null
, the area behaves
like a line series with fill between the graph and the Y axis minimum.
plotOptions.area.marker
Extends plotOptions.series.marker
plotOptions.area.marker.states
Extends plotOptions.series.marker.states
plotOptions.area.marker.states.hover
Extends plotOptions.series.marker.states.hover
plotOptions.area.marker.states.select
Extends plotOptions.series.marker.states.select
plotOptions.area.dataGrouping
Extends plotOptions.series.dataGrouping
plotOptions.area.dataLabels
Extends plotOptions.series.dataLabels
plotOptions.area.events
Extends plotOptions.series.events
plotOptions.area.point
Extends plotOptions.series.point
plotOptions.area.point.events
Extends plotOptions.series.point.events
plotOptions.area.states
Extends plotOptions.series.states
plotOptions.area.states.hover
Extends plotOptions.series.states.hover
plotOptions.area.states.hover.marker
Extends plotOptions.series.states.hover.marker
plotOptions.areaspline
Extends plotOptions.area
plotOptions.areaspline.marker
Extends plotOptions.area.marker
plotOptions.areaspline.marker.states
Extends plotOptions.area.marker.states
plotOptions.areaspline.marker.states.hover
Extends plotOptions.area.marker.states.hover
plotOptions.areaspline.marker.states.select
Extends plotOptions.area.marker.states.select
plotOptions.areaspline.dataGrouping
Extends plotOptions.area.dataGrouping
plotOptions.areaspline.dataLabels
Extends plotOptions.area.dataLabels
plotOptions.areaspline.events
Extends plotOptions.area.events
plotOptions.areaspline.point
Extends plotOptions.area.point
plotOptions.areaspline.point.events
Extends plotOptions.area.point.events
plotOptions.areaspline.states
Extends plotOptions.area.states
plotOptions.areaspline.states.hover
Extends plotOptions.area.states.hover
plotOptions.areaspline.states.hover.marker
Extends plotOptions.area.states.hover.marker
plotOptions.column
Extends plotOptions.series
options.colors
collection, this option determines whether the chart should receive
one color per series or one color per point.
null
,
the width is calculated from the pointPadding
and groupPadding
.
plotOptions.column.dataGrouping
Extends plotOptions.series.dataGrouping
plotOptions.column.dataLabels
Extends plotOptions.series.dataLabels
plotOptions.column.events
Extends plotOptions.series.events
plotOptions.column.point
Extends plotOptions.series.point
plotOptions.column.point.events
Extends plotOptions.series.point.events
plotOptions.column.states
Extends plotOptions.series.states
plotOptions.column.states.hover
Extends plotOptions.series.states.hover
plotOptions.column.states.hover.marker
Extends plotOptions.series.states.hover.marker
plotOptions.ohlc
Extends plotOptions.column
plotOptions.ohlc.dataGrouping
plotOptions.ohlc.dataLabels
Extends plotOptions.column.dataLabels
plotOptions.ohlc.events
Extends plotOptions.column.events
plotOptions.ohlc.point
Extends plotOptions.column.point
plotOptions.ohlc.point.events
Extends plotOptions.column.point.events
plotOptions.ohlc.states
Extends plotOptions.column.states
plotOptions.ohlc.states.hover
Extends plotOptions.column.states.hover
plotOptions.ohlc.states.hover.marker
Extends plotOptions.column.states.hover.marker
plotOptions.candlestick
Extends plotOptions.column
plotOptions.candlestick.dataGrouping
Extends plotOptions.column.dataGrouping
plotOptions.candlestick.dataLabels
Extends plotOptions.column.dataLabels
plotOptions.candlestick.events
Extends plotOptions.column.events
plotOptions.candlestick.point
Extends plotOptions.column.point
plotOptions.candlestick.point.events
Extends plotOptions.column.point.events
plotOptions.candlestick.states
Extends plotOptions.column.states
plotOptions.candlestick.states.hover
Extends plotOptions.column.states.hover
plotOptions.candlestick.states.hover.marker
Extends plotOptions.column.states.hover.marker
plotOptions.flags
Extends plotOptions.column
style: { fontSize: '11px', fontWeight: 'bold', textAlign: 'center' }
plotOptions.flags.dataGrouping
Extends plotOptions.column.dataGrouping
plotOptions.flags.dataLabels
Extends plotOptions.column.dataLabels
plotOptions.flags.events
Extends plotOptions.column.events
plotOptions.flags.point
Extends plotOptions.column.point
plotOptions.flags.point.events
Extends plotOptions.column.point.events
plotOptions.flags.states
Extends plotOptions.column.states
plotOptions.flags.states.hover
Extends plotOptions.column.states.hover
plotOptions.ohlc.states.hover.marker
Extends plotOptions.column.states.hover.marker
labels
style: { color: '#3E576F' }
labels.items
style: { left: '100px', top: '100px' }
legend
style
unless overridden here. Defaults to:
itemHiddenStyle: { color: '#CCC' }
style
unless overridden here. Defaults to:
itemHoverStyle: { color: '#000' }
itemStyle: { cursor: 'pointer', color: '#3E576F' }
labelFormatter: function() { return this.name }
backgroundColor
also needs to be applied for this to take effect.
align
, verticalAlign
, x
and y
,
but the styles are still parsed for backwards compatibility.
y
option.
align
within chart.spacingLeft and chart.spacingRight. Negative
x moves it to the left, positive x moves it to the right. The default value of
15 together with align: "center"
puts it in the center of the
plot area.
verticalAlign
within chart.spacingTop and chart.spacingBottom. Negative
y moves it up, positive y moves it down.
loading
chart.showLoading()
. It is a utility for developers to communicate
to the end user that something is going on, for example while retrieving new data
via an XHR connection. The "Loading..." text itself is not part of this configuration
object, but part of the lang
object.
span
. Defaults to:
labelStyle: { fontWeight: 'bold', position: 'relative', top: '1em' }
style: { position: 'absolute', backgroundColor: 'white', opacity: 0.5, textAlign: 'center' }
tooltip
null
, the border takes the color of the
corresponding series or point.
point.change
value when the series.compare
option is set. This is overridable in each series' tooltip options object.
The default is to preserve all decimals.
- Boolean
- If the crosshairs option is true, a single crosshair relating to the x axis will be shown.
- Array of booleans
- In an array of booleans, the first value turns on the x axis crosshair and the second
value to the y axis crosshair. Use
[true, true]
to show complete crosshairs. - Array of objects
- In an array of objects, the first value applies to the x axis crosshair and the second
value to the y axis crosshair. For each dimension, a
width
,color
dashStyle
andzIndex
can be given. can be given.
The HTML of the tooltip header line. Variables are enclosed by curly brackets. Available variables are point.key, series.name and series.color. The point.key variable contains the category name, x value or datetime string depending on the type of axis. For datetime axes, the point.key date format can be set using tooltip.xDateFormat.
Defaults to <span style="font-size: 10px">{point.key}</span><br/>
Callback function to format the text of the tooltip from scratch. Return false to disable tooltip for a specific point on series.
A subset of HTML is supported. The HTML of the tooltip is parsed and converted to SVG,
therefore this isn't a complete HTML renderer. The following tabs are supported:
<b>
, <strong>
,
<i>
, <em>
, <br/>
, <span>
.
Spans can be styled with a style
attribute, but only text-related CSS that is
shared with SVG is handled.
Since version 2.1 the tooltip can be shared between multiple series through
the shared
option. The available data in the formatter differ a bit
depending on whether the tooltip is shared or not. In a shared tooltip, all
properties except x
, which is common for all points, are kept in
an array, this.points
.
Available data are:
- this.percentage (not shared) / this.points[i].percentage (shared)
- Stacked series and pies only. The point's percentage of the total.
- this.point (not shared) / this.points[i].point (shared)
- The point object. The point name, if defined, is available
through
this.point.name
. - this.points
- In a shared tooltip, this is an array containing all other properties for each point.
- this.series (not shared) / this.points[i].series (shared)
- The series object. The series name is available
through
this.series.name
. - this.total (not shared) / this.points[i].total (shared)
- Stacked series only. The total value at this point's x value.
- this.x
- The x value. This property is the same regardless of the tooltip being shared or not.
- this.y (not shared) / this.points[i].y (shared)
- The y value.
The HTML of the point's line in the tooltip. Variables are enclosed by curly brackets. Available variables are point.x, point.y, point.change, series.name and series.color and other properties on the same form. Furthermore, point.y can be extended by the tooltip.yPrefix and tooltip.ySuffix variables. This can also be overridden for each series, which makes it a good hook for displaying units.
Defaults to <span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>
.highcharts-tooltip
.
Default value:
style: { color: '#333333', fontSize: '9pt', padding: '5px' }
credits
align
, verticalAlign
, x
and y
.
Defaults to
position: { align: 'right', x: -10, verticalAlign: 'bottom', y: -5 }
itemStyle: { cursor: 'pointer', color: '#909090', fontSize: '10px' }
global
lang
options, must be set using the Highcharts.setOptions
method.
Highcharts.setOptions({ global: { useUTC: false } });
Highcharts.dateFormat
. Advantages of using UTC is that the time
displays equally regardless of the user agent's time zone settings. Local time
can be used when the data is loaded in real time or when correct Daylight Saving Time
transitions are required.
colors
colors: [ '#4572A7', '#AA4643', '#89A54E', '#80699B', '#3D96AE', '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92' ]
symbols
symbols: [ 'circle', 'diamond', 'square', 'triangle', 'triangle-down' ]
lang
Highcharts.setOptions
to
set it before any chart is initiated.
Highcharts.setOptions({ lang: { months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Ao?t', 'Septembre', 'Octobre', 'Novembre', 'Décembre'], weekdays: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'] } });
Highcharts.numberFormat
method
unless otherwise specified in the function arguments.
chart.showLoading
.
%b
format in Highcharts.dateFormat()
.
Highcharts.numberFormat
method
unless otherwise specified in the function arguments.
series
plotOptions
for that specific
type of plot can be added to a series individually. For example, even though a general
lineWidth
is specified in plotOptions.series
, an individual
lineWidth
can be specified for each series.- A list of numerical values. In this case, the numerical values will
be interpreted as y values, and x values will be automatically calculated,
either starting at 0 and incrementing by 1, or from
pointStart
andpointInterval
given in the plotOptions. Example:data: [0, 5, 3, 5]
- A list of arrays with two values. In this case, the first value is the
x value and the second is the y value. If the first value is a string, it is
applied as the name of the point, and the x value is incremented following
the above rules. Example:
data: [[5, 2], [6, 3], [8, 2]]
- A list of object with named values. In this case the objects are
point configuration objects as seen under
options.point. Example:
data: [{ name: 'Point 1', color: '#00FF00', y: 0 }, { name: 'Point 2', color: '#FF00FF', y: 5 }]
area
, areaspline
,
bar
, column
, line
, pie
,
scatter
, spline
, candlestick
or ohlc
.
point
chart.get()
.
point.events
Extends plotOptions.series.point.events
point.marker
Extends plotOptions.series.marker
navigator
series: { type: 'areaspline', color: '#4572A7', fillOpacity: 0.4, dataGrouping: { smoothed: true }, lineWidth: 1, marker: { enabled: false }, shadow: false }
xAxis: { tickWidth: 0, lineWidth: 0, gridLineWidth: 1, tickPixelInterval: 200, labels: { align: 'left', x: 3, y: -4 } }
yAxis: { gridLineWidth: 0, startOnTick: false, endOnTick: false, minPadding: 0.1, maxPadding: 0.1, labels: { enabled: false }, title: { text: null }, tickWidth: 0 }
scrollbar
rangeSelector
type
- Defines the timespan, can be one of 'millisecond', 'second', 'minute', 'day', 'week', 'month', 'ytd' (year to date), 'year' and 'all'.
count
- Defines how many units of the defined type to use.
text
- The text for the button itself
buttons: [{ type: 'month', count: 1, text: '1m' }, { type: 'month', count: 3, text: '3m' }, { type: 'month', count: 6, text: '6m' }, { type: 'ytd', text: 'YTD' }, { type: 'year', count: 1, text: '1y' }, { type: 'all', text: 'All' }]
fill
,
stroke
, stroke-width
, as well as style
, a collection of CSS
properties for the text.
right
and top
for positioning,
alternatively set right
and top
to 'auto'
and set left
or bottom
instead.
navigation
menuStyle: { border: '1px solid #A0A0A0', background: '#FFFFFF' }
menuItemStyle: { padding: '0 5px', background: NONE, color: '#303030' }
menuItemHoverStyle: { background: '#4572A5', color: '#FFFFFF' }
navigation.buttonOptions
backgroundColor: { linearGradient: [0, 0, 0, 20], stops: [ [0.4, '#F7F7F7'], [0.6, '#E3E3E3'] ] }
verticalAlign
.
exporting
chart.exportChart()
is called
without specifying a type
option. Possible values are image/png
,
image/jpeg
, application/pdf
and image/svg+xml
.
exporting.buttons
exporting.buttons.exportButton
Extends navigation.buttonOptions
A collection of config options for the menu items. Each options object consists
of a text
option which is a string to show in the menu item, as
well as an onclick
parameter which is a callback function to run
on click.
By default, there is one menu item for each of the available export types.
Menu items can be customized by defining a new array of items and assigning
null
to unwanted positions (see override example below).
Highcharts.Renderer.symbols
collection. The default
exportIcon
function is part of the exporting module.
exporting.buttons.printButton
Extends navigation.buttonOptions
chart.print()
, but it can be overridden to do other actions.
Highcharts.Renderer.symbols
collection. The default
print
function is part of the exporting module.
The Highcharts Namespace
The namespace under which all other Highcharts variables are assembled is called
Highcharts
.
var chart1 = new Highcharts.Chart(options);
Methods
This is the constructor for creating a new basic chart object (not Stock chart).
var chart1 = new Highcharts.Chart(options);
Parameters
-
options: Object
The chart options, as documented under the heading "The options object" in the left menu. -
callback: Function
A function to execute when the chart object is finished loading and rendering. In most cases the chart is built in one thread, but in Internet Explorer version 8 or less the chart is sometimes initiated before the document is ready, and in these cases thechart
object will not be finished directly after callingnew Highcharts.Chart()
. As a consequence, code that relies on the newly built Chart object should always run in the callback. Defining achart.event.load
handler is equivalent.
Returns
- A reference to the created
Chart
object.
Formats a JavaScript date timestamp (milliseconds since Jan 1st 1970) into a human readable date string. The format is a subset of the formats for PHP's strftime function.
Currently these formats are supported:
- %a: Short weekday, like 'Mon'.
- %A: Long weekday, like 'Monday'.
- %d: Two digit day of the month, 01 to 31.
- %e: Day of the month, 1 through 31.
- %b: Short month, like 'Jan'.
- %B: Long month, like 'January'.
- %m: Two digit month number, 01 through 12.
- %y: Two digits year, like 09 for 2009.
- %Y: Four digits year, like 2009.
- %H: Two digits hours in 24h format, 00 through 23.
- %I: Two digits hours in 12h format, 00 through 11.
- %l (Lower case L): Hours in 12h format, 1 through 11.
- %M: Two digits minutes, 00 through 59.
- %p: Upper case AM or PM.
- %P: Lower case AM or PM.
- %S: Two digits seconds, 00 through 59
tooltip: { formatter: function() { return '<strong>'+ this.series.name +'</strong>'+ Highcharts.dateFormat('%e. %b %Y, %H:00', this.x) +': '+ this.y +' m/s'; } }, ...
Parameters
-
format: String
A string containing some of the formats above. -
time: Number
The JavaScript time to format. -
capitalize: Boolean
Whether to capitalize words in the return string.
Returns
- A string with any format symbol replaced.
Formats a JavaScript number with grouped thousands, a fixed amount of decimals and an optional decimal point. It is a port of PHP's function with the same name. See PHP number_format for a full explanation of the parameters.
tooltip: { formatter: function() { return ''+ this.series.name +''+ this.x +': '+ Highcharts.numberFormat(this.y, 0, ',') +' millions'; } }, ...
Parameters
-
number: Number
The raw number to format. -
decimals: Number
The desired number of decimals. -
decimalPoint: String
The decimal point. Defaults to "." or to the string specified globally in options.lang.decimalPoint. -
thousandsSep: String
The thousands separator. Defaults to "," or to the string specified globally in options.lang.thousandsSep.
Returns
- A string with with the input number formatted.
Sets the options globally for all charts created after this has been called. Takes an options JavaScript object structure as the argument. These options are merged with the default options and the result is returned.
Parameters
-
options: Object
The chart configuration object.
Returns
- The new options, a merge between the default options and the user set options.
This is the constructor for creating a new stock chart object. Basically a stock chart object is the same as a Chart object with some different default options.
var chart1 = new Highcharts.StockChart(options);
Parameters
-
options: Object
The chart options, as documented under the heading "The options object" in the left menu. -
callback: Function
A function to execute when the chart object is finished loading and rendering. In most cases the chart is built in one thread, but in Internet Explorer version 8 or less the chart is sometimes initiated before the document is ready, and in these cases thechart
object will not be finished directly after callingnew Highcharts.Chart()
. As a consequence, code that relies on the newly built Chart object should always run in the callback. Defining achart.event.load
handler is equivalent.
Returns
- A reference to the created
Chart
object.
Highcharts.Renderer
Allows direct access to the Highcharts rendering layer in order to draw primitive shapes like circles, rectangles, paths or text directly on a chart, or independent from any chart. The Renderer represents a wrapper object for SVG in modern browsers and VML in IE < 8.
An existing chart's renderer can be accessed through chart.renderer
. To create a renderer independent
from a chart, use var renderer = new Highcharts.Renderer(parentNode, width, height);
where parentNode
is the HTML element where you want to add it.
The Renderer's methods are chained whereever possible, so you can initiate an element then call for example attr
and css
and add
on that element in one statement.
Draw an arc on the renderer canvas.
Parameters
-
centerX: Number
The x position of the arc's center in the SVG element. -
centerY: Number
The y position of the arc's center in the SVG element. -
outerRadius: Number
The outer radius of the arc. -
innerRadius: Number
The inner radius of the arc. -
start: Number
The starting angle of the arc in radians, where 0 is to the right and -Math.PI/2 is up. -
end: Number
The ending angle of the arc in radians, where 0 is to the right and -Math.PI/2 is up.
Returns
- An Element object.
Draw circle on the renderer canvas.
Parameters
-
centerX: Number
The x position of the circle's center in the SVG element. -
centerY: Number
The y position of the circle's center in the SVG element. -
radius: Number
The radius of the circle.
Returns
- An Element object.
Add an SVG/VML group.
Parameters
-
name: String
The name of the group. This will be used in the class name, which will be"highcharts-"+ name
. Other Element objects are added to the group by using the group as the first parameter in .add() for the wrappers.
Returns
- An Element object.
Add an image from an external resource.
Parameters
-
source: String
The URL of the image. -
x: String
The x position of the image's upper left corner. -
y: String
The y position of the image's upper left corner. -
width: String
The width of the image. -
height: String
The height of the image.
Returns
- An Element object.
Add a path based on SVG's path commands. In SVG capable browsers all path commands are supported, but in VML only a subset is supported, most notably moveTo, lineTo and curve commands.
Parameters
-
path: Array
An SVG path split up in array form.
Returns
- An Element object.
Add a rectangle.
Parameters
-
x: Number
The x position of the rectangle's upper left corner. -
y: Number
The y position of the rectangle's upper left corner. -
width: Number
The width of the rectangle. -
height: Number
The height of the rectangle. -
cornerRadius: Number
The corner radius of all the rectangle's corners.
Returns
- An Element object.
Draw text. The text can contain a subset of HTML, like spans and anchors and some basic text styling of these.
Parameters
-
str: String
The text or HTML to draw -
x: Number
The x position of the text's lower left corner. -
y: Number
The y position of the text's lower left corner.
Returns
- An Element object.
The Element object
The Element class is a JavaScript wrapper for SVG elements used in the rendering layer of Highchart. Combined with the Renderer object, these elements allows freeform annotation in the charts or even in your HTML pages without creating a chart at all.
Add the element to the renderer canvas.
Parameters
-
parent: Object
The element can be added to ag
(group) element.
Returns
- An Element object.
Apply attributes to the SVG/VML elements. These attributes for the most parts correspond
to SVG, but some are specific to Highcharts, like zIndex
and rotation
for text.
Most important available attributes:
- d
- The path definition for a
path
element. - end
- The end position of an arc.
- fill
- The fill or background color of a shape.
- height
- The height of rectangle elements.
- r
- The radius of an arc or circle.
- rotation
- The rotation of a text element.
- start
- The start position of an arc.
- stroke
- The stroke or border color of an element.
- stroke-width
- The stroke or border width of an element.
- style
- A serialized CSS string.
- text
- The text string of a text element.
- translateX
- The x translation of an element.
- translateY
- The Y translation of an element.
- visibility
- The visibility of the element. Can be 'visible' or 'hidden'.
- width
- The width of rectangle elements.
- x
- The x position of supported elements.
- y
- The y position of supported elements.
- zIndex
- The z index or vertical stacking of an element..
Parameters
-
hash: Object
A set of attributes to apply.
Returns
- An Element object.
Apply some CSS properties to the element
Parameters
-
hash: Object
The object literal of CSS properties to apply. Properties should be hyphenated, not camelCased.
Returns
- An Element object.
Destroy the element and free up memory
Returns
- null
Get the bounding box of the element
Returns
- A hash object containing x, y, width and height values for the element.
Apply an event handler to the element
Parameters
-
eventType: String
The event type to attach, for example 'click', 'mouseover', 'touch'. -
handler: Function
The event handler function.
Returns
- The element object
Bring the element to the front. Alternatively, a zIndex attribute can be given.
Returns
- The element object
The Chart object
The chart object is the JavaScript object representing a single chart in the web page.
The pointer to your chart object is returned when a chart is created using
the Highcharts.Chart()
constructor:
var chart1 = new Highcharts.Chart(options);
Methods
Add a series to the chart after render time. Note that this method should never be used when adding data synchronously at chart render time, as it adds expense to the calculations and rendering. When adding data at the same time as the chart is initiated, add the series as a configuration option instead. In a StockChart with the navigator enabled, the base series can't be added dynamically.
Parameters
-
options: Object
The series options, as documented under plotOptions.series and under the plotOptions for each series type. -
redraw: Boolean
Defaults totrue
. Whether to redraw the chart after the series is added. See theredraw()
method below. -
animation: Mixed
Defaults to true. When true, the series' updating will be animated with default animation options. The animation can also be a configuration object with propertiesduration
andeasing
.
Returns
- The series added, if successful.
Removes the chart and purges memory. This method should be called before writing a new chart into the same container. It is called internally on window unload to prevent leaks.
Exporting module required. Submit an SVG version of the chart to a server along with some parameters for conversion.
Parameters
- options: Object
Exporting options. Out of the exporting options, the following options can be given as parameters to the exportChart method. All options default to the values given in the exporting config optins.filename
: the filename for the export without extension,url
: the URL for the server module to do the conversion,width
: the width of the PNG or JPEG image generated on the server,type
: the MIME type of the converted image. - chartOptions: Object
Additional chart options for the exported chart. For example a different background color can be added here.
Get an axis, series or point by its id
as given in the configuration options.
Parameters
-
id: String
The id of the axis, series or point to get.
Returns
- The first Axis, Series or Point with a matching id if found,
null
if not.
Returns an array of all currently selected points in the chart. Points can be selected either
programmatically by the point.select()
method or by clicking.
Returns
- An array of the selected points.
Returns an array of all currently selected series in the chart. Series can be selected either
programmatically by the series.select()
method or by checking the checkbox
next to the legend item if series.showCheckBox
is true.
Returns
- An array of the selected Series items.
Exporting module required. Get an SVG string representing the chart.
Parameters
- additionalOptions: Object
Chart options to add to the exported chart in addition to the options given for the original chart. For example if series.lineWidth should be greater in the exported chart than in the original, or the chart should have a different background color, this is added here.
Hide the loading screen. Options for the loading screen are defined at options.loading.
Exporting module required. Clears away other elements in the page and prints the chart as it is displayed. By default, when the exporting module is enabled, a button at the upper right calls this method.
Redraw the chart after changes have been done to the data or axis extremes. All methods
for updating axes, series or points have a parameter for redrawing the chart. This is
true
by default. But in many cases you want to do more than one operation
on the chart before redrawing, for example add a number of points. In those cases it is
a waste of resources to redraw the chart for each new point added. So you add the points
and call chart.redraw()
after.
The chart.redraw()
method only
redraws those parts of the chart that are actually changed. If the data of a series is
changed and it doesn't affect the axes, only the series itself is redrawn. If the new
data requires the axis extremes to be altered, the axis and all other series depending
on it are redrawn.
Resize the chart to a given width. Height is currently not supported by Stock charts.
Parameters
-
width: Number
The new pixel width of the chart. -
height: Not implemented yet
-
animation: Mixed
Defaults to true. When true, the resize will be animated with default animation options. The animation can also be a configuration object with propertiesduration
andeasing
.
Dim the chart's plot area and show a loading label text. Options for the loading screen are defined at options.loading. A custom text can be given as a parameter for loadind
Properties
chart.renderTo
.
chart.xAxis[0]
.
chart.yAxis[0]
.
The Axis object
A chart can have from 0 axes to multiples. In a normal, single series cartesian chart, there is one X axis and one Y axis.
The X axis or axes are referenced
by chart.xAxis
, which is an array of Axis objects. If there is only one
axis, it can be referenced through chart.xAxis[0]
, and multiple axes have
increasing indices. The same pattern goes for Y axes.
If you need to get the axes from a series object, use the series.xAxis
and
series.yAxis
properties. These are not arrays, as one series can only be associatedd
to one X and one Y axis.
A third way to reference the axis programmatically is by id. Add an id in the
axis configuration options, and get the axis by chart.get(id)
.
Configuration options for the axes are given in options.xAxis and options.yAxis.
Methods
Add a plot band after render time.
Parameters
- options: Object
A configuration object consisting of the same members as options.xAxis.plotBands
Add a plot line after render time.
Parameters
- options: Object
A configuration object consisting of the same members as options.xAxis.plotLines
Get the current extremes for the axis.
Returns
An object containing the following properties:
- dataMax: The maximum value of the axis' associated series.
- dataMin: The minimum value of the axis' associated series.
- max: The maximum axis value, either automatic or set manually. If
the
max
option is not set andmaxPadding
is 0, this value will be the same asdataMax
. - min: The minimum axis value, either automatic or set manually. If
the
min
option is not set andminPadding
is 0, this value will be the same asdataMin
.
Set the minimum and maximum of the axes after render time. If the
startOnTick
and endOnTick
options are true,
the minimum and maximum values are rounded off to the nearest tick. To prevent
this, these options can be set to false before calling setExtremes.
Parameters
- min: Number
The new minimum value - max: Number
The new maximum value - redraw: Boolean
Defaults totrue
. Whether to redraw the chart or wait for an explicit call tochart.redraw()
. -
animation: Mixed
Defaults to true. When true, the resize will be animated with default animation options. The animation can also be a configuration object with propertiesduration
andeasing
.
Remove a plot band by its id
.
Parameters
- id: String
The plot band'sid
as given in the original configuration object or in the addPlotBand method.
Remove a plot line by its id
.
Parameters
- id: String
The plot line'sid
as given in the original configuration object or in the addPlotLine method.
The Series object
The Series object is the JavaScript representation of each line, area series, pie etc.
The object can be accessed in a number of ways. All series and point event handlers
give a reference to the series object. The chart
object has a series
property that is a collection of all the chart's series. The point
objects
also have the same reference.
Another way to reference the series programmatically is by id. Add an id in the
series configuration options, and get the series object by chart.get(id)
.
Configuration options for the series are given in three levels. Options for all series in a chart are given in the plotOptions.series object. Then options for all series of a specific type are given in the plotOptions of that type, for example plotOptions.line. Next, options for one single series are given in the series array.
Methods
Add a point to the series after render time.
Parameters
-
options: Number|Array|Object
The point options. If options is a single number, a point with that y value is appended to the series. If it is an array, it will be interpreted as x and y values respectively, or in the case of OHLC or candlestick, as[x, open, high, low, close]
. If it is an object, advanced options as outlined under options.point are applied. -
redraw: Boolean
Defaults totrue
. Whether to redraw the chart after the point is added. When adding more than one point, it is highly recommended that theredraw
option be set to false, and insteadchart.redraw()
is explicitly called after the adding of points is finished. -
shift: Boolean
Defaults tofalse
. When shift is true, one point is shifted off the start of the series as one is appended to the end. Use this option for live charts monitoring a value over time. -
animation: Mixed
Defaults to true. When true, the graph will be animated with default animation options. The animation can also be a configuration object with propertiesduration
andeasing
.
Hides the series if visible. If the chart.ignoreHiddenSeries
option is true,
the chart is redrawn without this series.
Remove the series from the chart.
Parameters
-
redraw: Boolean
Defaults totrue
. Whether to redraw the chart after the series is removed. If doing more operations on the chart, it is a good idea to set redraw to false and callchart.redraw()
after.
Select or unselect the series. This means its selected
property is set,
the checkbox in the legend is toggled and when selected, the series is returned in the
chart.getSelectedSeries()
method.
Parameters
- selected: Boolean|null
Whentrue
, the series is selected. Whenfalse
it is unselected. Whennull
orundefined
, the series' selection state is toggled.
Apply a new set of data to the series and optionally redraw it.
Parameters
-
data: Array<Number>|Array<Array>|Array<Object>
Takes an array of data in the same format as given at options.series => data. -
redraw: Boolean
Defaults totrue
. Whether to redraw the chart after the series is altered. If doing more operations on the chart, it is a good idea to set redraw to false and callchart.redraw()
after.
Properties
series.xData
and series.yData
. Additionally, series.options.data
contains all configuration objects for the points, whether they be numbers, arrays or objects.
series.select()
.
series.show()
,
series.hide()
, or the initial configuration.
The Point object
The Point object is the JavaScript representation of each data point
The object can be accessed in a number of ways. In all point event handlers the
point object is this
. In the series
object all the points
are accessed by the series.data
array.
Another way to reference the point programmatically is by id. Add an id in the
point configuration options, and get the point object by chart.get(id)
.
Methods
Remove the point from the series.
Parameters
-
redraw: Boolean
Defaults totrue
. Whether to redraw the chart after the point is removed. If doing more operations on the chart, it is a good idea to set redraw to false and callchart.redraw()
after. -
animation: Mixed
Defaults to true. When true, the graph's updating will be animated with default animation options. The animation can also be a configuration object with propertiesduration
andeasing
.
Select or unselect the point.
Parameters
-
select: Boolean
Whentrue
, the point is selected. Whenfalse
, the point is unselected. Whennull
orundefined
, the selection state is toggled. -
accumulate: Boolean
Whentrue
, the selection is added to other selected points. Whenfalse
, other selected points are deselected. Internally in Highcharts, selected points are accumulated on Control, Shift or Cmd clicking the point.
Update the point with new values.
Parameters
-
options: Number|Array|Object
The point options. If options is a single number, the point will be given that number as the y value. If it is an array, it will be interpreted as x and y values respectively. If it is an object, advanced options as outlined under options.point are applied. -
redraw: Boolean
Defaults totrue
. Whether to redraw the chart after the point is updated. If doing more operations on the chart, it is a good idea to set redraw to false and callchart.redraw()
after. -
animation: Mixed
Defaults to true. When true, the update will be animated with default animation options. The animation can also be a configuration object with propertiesduration
andeasing
.


Join our amazing team and learn how to build the best robots.
Like to create? So do we. Since our inception, we've strived to provide a space that allows students to succeed alongside their peers as a team. Robotics isn't exactly easy, but that's what makes us stronger.
From our seasoned design leads to our young and enterprising engineers, we welcome anyone willing to put themselves to the test and compete against thousands of bright minds from around the world. As we move forward, we will grow, take on new competitions, and complete more projects.
We are a community of designers, creators, and innovators.
We are RoboBears.


Capture Data
Loading...
Video Feed
Skeleton Image
Initial Number:
Pose Name:
Capture Single Frame
Capture
Capture Multiple Frames (3s timer)
Start Recording
Stop Recording
Create new Zip file (Reset)
Download Zip
Number of files in zip:
0


PH Land Registry
Sign out
Land Records
Land Registration
Settings
Register Land Property
Survey Number:
Area (sqm):
Complete location:
Village:
Barangay:
City/Minucipality:
Province:
Owner's address:
Date of Registration:
Market Value (ETH):
Next
You are about to register a land asset.
×
Survey Number:
Area:
Comeplete Location:
Owner:
Market Value:


Choose a recipient from list of trendy galleries, or art prizes:
Choose a template for the text of the mail:
Define a mail server
To send the email Nomin needs the address and the port of open SMTP mail server.
You can insert one manually or use our handy list of open SMTP servers.
In case of any troubles, you can
get more information here.


Basic concepts of Coding
Learned the web is composed of the following:
1. HTML: HyperText Markup Language; the heart of the web
2. URLs: The hyperlinks to navigate between pages
3. HTTP: Computer protocols and,
4. Web Applications: (don't remember the specifics of this one)
Learned the difference between 'inline' and 'block' tags' and their significance, though details about when to use one over the other wasn't covered.
The Absolute funEST part was learning about the tags that allowed me to start coding
immediately. Stephen explained the process simply enough from me to be able to catch on quickly.


Index File
Silver Blaze
The Adventure of the Six Napoleans
The Adventure of the Speckled Band
The Naval Treaty
The Red Headed League


# React Router
.title-logo[![Red logo](/public/img/red-logo-white.svg)]
# Agenda
1. Container vs. Presentational Components
2. Using React Router
# Container vs. Presentational Components
# Why the Diff?
In React, it's very easy to mix code that controls the behaviour of our app with code that renders the view.
As a result, our code will become more **tightly coupled** than it should be. This makes our components less modular and harder to reuse.
To avoid this, we will organize our project into **Container Components** and **Presentational Components**.
# In Use
We've already seen an approximate example of this pattern in the to-do app—where the stateful `App` component **passes down props** to a stateless child component.
We have also seen how a stateful parent component **can pass down an event handler too** to a stateless child component. The child component then uses that event handler to update the parent's state.
.large[
Container components are concerned with **how things work**.
]
.large[
Presentational components are concerned with **how things look**.
]
# Cheatsheet #1
*Container components:*
- Should be responsible for **fetching data**
- Should **define event handlers** and pass them down as props
*Presentational components:*
- Should **never change prop data** (only receive it)
- Should **format the data** for the view only
.large[
Knowing this, what type of components should we use for presentational and container components?
]
# Cheatsheet #2
Container | Presentational
----------|---------------
Stateful | Stateless
Classes | Functions
Impure | Pure
**Note:** Container and presentational components can be represented on either side of these dichotomies, however, presentational components tend to be **stateless, pure functions** while container components tend to be **stateful classes** that **may or may not be pure**.
# In Practice
```js
// CONTAINER COMPONENT
class Posts extends React.Component {
constructor() {
super();
this.state = {
posts: [{ title: 'Hello, world!' }]
};
}
render() {
return ;
}
}
// PRESENTATIONAL COMPONENT
const PostList = ({ posts }) => (
{ posts.map((post) =>
{post.title}
) }
);
```
# Exercise 1
Review the components that you have created for the Boomtown app so far. What should be classified as a container component, and what should be classified as a presentational component?
Do some project reorganization based on these observations. Remember that your `import` file paths will likely break when you do this and you'll need to fix them!
# Routing with React
### What is routing?
Routing allows us to create readable URLs that describe the content loaded in a single-page application, and allows the user to navigate forward and backward through a SPA.
In other words, routing allows us to take a path and use it to generate the correct components to populate the UI.
# About Routing
**Note!**
We're building a SPA, so our application uses **a single static HTML file** to display all of it's content.
**When routes changes** in our application, we must ensure that:
- The URL in the address bar reflects what is being shown
- Forward and back nav work in the browser
- The user can navigate to a new URL and they will see the expected view
# Exercise 2
Visit **[Reddit](http://reddit.com)**. Click on several links and map out how the urls are structured:
- hot posts
- new posts
- submitting posts
- comment on posts
- a subReddit
- showing posts only posted in the past hour
# An Example
Let's create a new React app to test out some of React Router's features. First run:
`create-react-app router-demo`
Then install React Router:
`npm install react-router-dom --save`
*Remember that React is a library, not a framework. Installing `react-router-dom` gives it more framework-like capabilities.*
# Adding the Router
To use React Router, we'll need to import it into our app.
Add this code to your `App.js` file:
```js
import {
BrowserRouter as Router,
Route,
Switch,
Link,
Redirect
} from 'react-router-dom';
```
# Router Basics
We just imported four different modules that we will use set up routing in our app:
- `BrowserRouter`: used to wrap all of the routes we define
- `Route`: used for identifying each route (inclusively)
- `Switch`: used to render the first child `Route` that matches the location
- `Link`: used to navigate around an application
- `Redirect`: used to navigate to a new location, like server-side redirects (HTTP 3xx) do
# Adding the Router
Now replace the default app content with the following:
```js
const Home = () =>
Hello, World!
;
const Contact = () =>
Get in touch!
;
class App extends Component {
render() {
return (
);
}
}
```
# Adding the Router
*Things to note...*
`Router` and `Route` **don't render anything by themselves**. They just define rules for our app. Each `Route` renders its `component`.
Also note that `Router` **can only have one child**, so multiple `Route` components should be wrapped in a `div`, etc.
Lastly, the `exact` qualifier ensures that the `path` prop **exactly matches what's in the browser address bar** before rendering the component.
# Adding a 404 Page
We can also use the `Route` component to render something for any undefined route. First, create a component to render when there's a 404:
```js
const NotFound = () =>
Whoops. You broke the internet again.
;
```
Then add the route:
```js
```
Look ma, no path! But now there's a bug we need to fix...
# Switch
`Switch` allows us to render a route **exclusively**, i.e. it allows us to pick only one `Route` to render at a given path:
```js
```
# Rendering: 3 Ways
There are 3 ways to show components for a given `Route`.
We have already seen the first, using the `component` prop:
```js
```
# Rendering: 3 Ways
We can also use the `render` prop and pass it a function:
```js
Hello, World!
} />
```
**Note:** Defining this function elsewhere (rather than passing in an anonymous function) would likely be preferable though.
# Rendering: 3 Ways
Lastly, we can use the `children` prop:
```js
match &&
It matched!
}
/>
```
The difference between `render` and `children` is that the function passed into `children` will always run (regardless of whether there is a match), **unless** you explicitly check for a match using the `match` parameter in the function.
# Link Components
The `Link` component allows you to link directly to the routes you have defined. Let's make a nav bar for our app:
```js
const NavBar = () => (
Home
Contact {/* include forward slash! */}
);
```
```js
```
# NavLink Components
The `NavLink` component is like a `Link`, but with special feature that makes it better for setting up navigation menus.
Ultimately, it allows us to add style-related attributes to the rendered element when it matches the current URL.
Let's' use the `NavLink` instead. First, import the component from `react-router-dom`:
```js
import {
// ...other imports
NavLink
} from 'react-router-dom';
```
# NavLink Components
Note that if you added any qualifiers to your route you need to add the same ones to your `NavLink` as well...
```css
.selected {
color: red;
}
```
```js
const NavBar = () => (
HomeContact
);
```
You can also use the `activeStyle` prop with the `NavLink` and pass it a style object.
# Nested Routes
What if we want to define routes somewhere that isn't the top-level `App` component?
We can use **nested routes** for that. Let's start by adding a route for a Posts page in our `App` component:
```js
```
# Nested Routes
Now create your `Posts` component with its nested routes:
```js
const Posts = ({ match }) => (
Blog
Hello, World!
}
/>
Scram, World!
}
/>
);
```
Note the use of `match` to dynamically grab the path of the `Posts` component route.
# Redirects
Redirects, as they suggest take the user to a different route. They can be rendered for or nested in a route:
```js
(
loggedIn ? (
) : (
)
) />
```
Or used inside a `Switch` component:
```js
```
# URL Parameters
URL parameters allow us to navigate to routes with some sort of variable segment in the URL using via **route matching**:
```js
const Posts = ({ match }) => (
Blog
{match.params.name}
}
/>
);
```
*Much DRYer!*
# URL Parameter Example
Back to [reddit.com](https://www.reddit.com/):
```bash
# homepage
/
# re-directs to /subreddits
/r
# homepage of Subreddit
/r/space
# browse all comments for the Subreddit
/r/space/comments
# redirects to URL below
/r/space/comments/5lxs89
# browse comments page for post
/r/space/comments/5lxs89/clouds_of_andromeda
# URL for specific comment
/r/space/comments/5lxs89/clouds_of_andromeda/dbztmtr
```
# URL Parameter Example
If we were building actual Reddit in React, our specific comment URLs might look like this:
```bash
/r/:subRedditName/comments/:postId/:postName/:commentId
```
The parts that start with `:` are URL parameters whose values will be parsed out and made available in `props.match.params.PARAM_NAME` in your component.
# Query Strings
React Router 4 **does not have a built-in way to parse query strings** at the end of an URL (e.g. `?sort=popular`).
You can, however, link to an URL with a query string in the `to` props of a `Link` component like this:
```js
Sort by Popularity
```
Add this to your `Posts` component. You can then access the query string for the route in `props.location.search`.
# Query String Example
We can then use the emerging [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) standard to parse the query string, but we will need to add a polyfill to ensure support for older browsers:
```bash
npm install url-search-params-polyfill --save
```
Then import the polyfill wherever you plan on instantiaing a new `URLSearchParams`:
```js
import 'url-search-params-polyfill';
```
# Query String Example
You can then parse your query string `id` param like this:
```js
const Posts = ({ match, location }) => {
const searchParams = new URLSearchParams(location.search);
const sortValue = searchParams.get('sort');
return (
Blog
Sort by Popularity
{match.params.name}
}
/>
{sortValue &&
You are sorting by "{sortValue}" right now.
}
)
};
```
# Exercise 3
Based on what you just learned in the preceding examples, apply this to your project now. You will need to create routes that point users to:
- The Items List page (`/`)
- The Login page (`/login`)
- The Share an Item page (`/share`)
- The individual User Profile pages (`/profile/[ID_HERE]`)
- A 404 page
# History and URLs
# Dealing with History
React Router offers more than one type of top-level router component. We have see the `BrowserRouter` so far, but there's also a `HashRouter`.
Hash history **works without configuring a server**. It uses `window.location.hash` and that's why we have `#` showing up in our URLs, even though we didn't put it there ourselves:
- **Home:** http://localhost:3000/#/
- **Contact:** http://localhost:3000/#/contact/
# Hash vs. Browser
The `BrowserRouter` (used in our demo) uses the **[Browser History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API)** and will eliminate the hashes from your URLs:
- **Home:** http://localhost:3000/
- **Contact:** http://localhost:3000/contact
**But there's a catch!** We need a server to use this...one that will always return `index.html` at any route. (Using the Browser History API also enables us to use server-side rendering.)
Luckily, there's a server already configured in Create React App.
# Browser History Demo
Try visiting this article about the Browser History API:
**https://css-tricks.com/using-the-html5-history-api/**
Open your dev tools console, and run this code, line by line:
```js
window.history
// Run this, then try navigating back and forth
history.replaceState(null, null, 'hello');
// Run this, now try navigating back and forth again
history.pushState(null, null, 'hello');
```
What do you notice? Be sure to watch the browser's address bar will you do this...
# Hash vs. Browser
*Some further clarification...*
- Hashes in URLs were meant to refer to a specific place in the document, so adding/changing a hash was a way to update the URL with `window.location` without refreshing the page (in a SPA)
- `hashHistory` works on the client side alone
- `browserHistory` (as stated) requires a server to always return `index.html` regardless of what "resource" is requested
# Hash vs. Browser
*Why bother with `hashHistory` at all?*
You would use `hashHistory` if you're worried about supporting
# Other Routers
`MemoryRouter`:
- An entirely in-memory router (doesn't depend on URLs in the browser address bar)
- Useful for testing and proof-of-concept
`StaticRouter`:
- Meant to be used with server-side rendering
`NativeRouter`:
- For use in React Native apps
# withRouter
Sometimes you need to access to the `history` object’s properties (or the `match` or `location` props) outside of named route in your app.
To do this, you can wrap the component that needs access to these props in the `withRouter` **higher-order component (HOC)** from React Router.
# withRouter
Example of `withRouter` in use:
```js
import React, { PropTypes } from 'react';
import { withRouter } from 'react-router-dom';
const Header = ({ history }) => (
);
Header.propTypes = {
match: PropTypes.object.isRequired,
location: PropTypes.object.isRequired,
history: PropTypes.object.isRequired
}
export default withRouter(Header); // THIS IS HOW WE USE IT!
```
*We'll do a lot more with HOCs in our app when we add Redux next week...*
# What We've Learned
- What container components and presentational components are for, and how to use them to make components more reusable
- How to use the `react-router` to set up SPA-style routing in a React app