dataLegendTextSeparater

This tweak split your keys with the separater and capitalize every word and insert a space in between.

Specification

Default implementation: { dataLegendTextSeparater : _ }

Key

Name Alias Category 
dataLegendTextSeparater data__legend__text__separater Data 

Value

Allow A-Z, a-b and 0-9 as value.

Default Validation Type 
"_" ^[a-zA-Z0-9]*$ String 

Example A.

Replace character "_" to " " in the legend text label

Output

Open output in a blank window. Download examples as zip.

Parameters

This dataset shows the mobile and desktop google pagerank performance score for a certain website.

  Value Type
Source "../data/performance.json" String
X "name" String
Y [ "mobile", "desktop" ] Array
Options { "showLegend" : true, "dataLegendTextSeparater" : "_" } Object

Source Code

  • Invoke Function
d3.statosio( 
    file, 
    "name", 
    [ "mobile",  "desktop" ], 
    { "showLegend" : true, "dataLegendTextSeparater" : "_" }
)
  • HTML Implementation
<!DOCTYPE html>
<head>
    <title>d3.statosio - dataLegendTextSeparater</title>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
    <meta content="utf-8" http-equiv="encoding">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/6.2.0/d3.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/statosio/0.9/statosio.js"></script>
</head>
<body>
    <script>
        d3.json( "../data/performance.json" )
            .then( ( file ) => {
                d3.statosio( 
                    file, 
                    "name", 
                    [ "mobile",  "desktop" ], 
                    { "showLegend" : true, "dataLegendTextSeparater" : "_" }
                )
            } )
    </script>
</body>