Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Adding renderingHints in the TS API results in diagram not drawn #92

Open
EHJ-52n opened this issue Sep 15, 2014 · 1 comment
Open

Adding renderingHints in the TS API results in diagram not drawn #92

EHJ-52n opened this issue Sep 15, 2014 · 1 comment
Assignees

Comments

@EHJ-52n
Copy link
Member

EHJ-52n commented Sep 15, 2014

I am adding some renderingHints in the TS API in the file WEB-INF/classes/config-rendering-hints.json like this

"phenomenonStyles": {
    "phe_5345345345": {
        "style": {
            "properties": {
                "color": "#0000ff"
            }
        }
    }
},

After relaunching the TS API and the js-sensorweb-client, the according time series gets rendered using the defined color in the legend but not in the diagram anymore.

When requesting the timeseries details from the TS API directly, the rendering hints are present like this:

renderingHints": {
    "chartType": "line",
    "properties": {
        "color": "#0000ff"
    }
}

In the Chart View the timeseries is not drawn.

In chrome, the console and network tab show no error according data retrieval or something similar.

@EHJ-52n
Copy link
Member Author

EHJ-52n commented Oct 15, 2014

The problem is solved if all required properties are defined. The required properties are documented in the TS API documentation:

The enhancement should be, that partially defined rendering hints should work, too. As a user I want to define only the color and nothing more. Hence, the client should use a default style and update it with the values from the rendering hints. The according code section is here:

var style = {};
if(meta.hasOwnProperty('renderingHints')) {
    var chartType = meta.renderingHints.chartType;
    var width = meta.renderingHints.properties.width;
    var color = meta.renderingHints.properties.color;
    var interval = meta.renderingHints.properties.interval;
    var lineType = meta.renderingHints.properties.type;
    style = new TimeseriesStyle(chartType, width, color, interval, lineType);
} else {
    style = TimeseriesStyle.createDefault(tsId);
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants