Search

Styling

Overview

KronoGraph allows you to style and customize items within the timeline. Basic item styling is defined within the data loaded into KronoGraph. For more on styling items, use the links below:

Override Styles

An override style is a visual property of an item in the timeline that can be changed without updating the properties of that item in the data.

Items that can have override styles applied are:

  • Entities - update glyph settings, change the color, label color, or line width, or fade the entity line outside the range of its associated events.
  • Events - update the color or line width, add or change a font icon or a label, show the event direction with an arrow, or apply a different event type.

You can change styles dynamically using event handlers or the timeline's internal state. Because item styles can be updated without having to reload the data, performance improves significantly.

Use the overrideStyles() overrideStyles API to update event and entity styling with the properties within the EntityStyle and EventStyle objects.

In the timeline below, override styles have been applied to 'event1', 'event3' and 'entity1'.

const newStyle = [
    { ids: ['event1', 'event3'], style: { color: 'red' } },
    { ids: ['entity1'], style: { glyph: { color: 'green' }, lineWidth: 3 } },
  ];
timeline.set(timelineData);
timeline.fit();
timeline.overrideStyles(newStyle);
export const Demo = () => {
  const newStyle = [
      { ids: ['event1', 'event3'], style: { color: 'red' } },
      { ids: ['entity1'], style: { glyph: { color: 'green' }, lineWidth: 3 } },
    ];
  return (
      <Timeline
        events={events}
        entities={entities}
        overrideStyles={newStyle}
      />
  );
};

ReactDOM.render(<Demo />, document.getElementById('my-timeline'));

Reset any override styles using an empty array.

See how you can use overrideStyles() overrideStyles with event handlers in the Interactive Styling example.

Terms of use

These terms do not alter or supersede any existing agreements between you (or your employer) and us.

By accessing or using any Content you agree to be bound by these Terms of Use. Please review these terms carefully before using the website.

The contents of this website, including but not limited to any text, code samples, API references, schemas, interactive tools, and other materials (collectively, the 'Content'), are made available for informational and internal evaluation purposes only. All intellectual property rights in the Content are reserved. No licence is granted to use the Content for any commercial purpose, or to copy, distribute, modify, reverse-engineer, or incorporate any part of the Content into any product or service, without our prior written consent.

This Content is provided “as is” and “as available,” without any representations, warranties, or guarantees of any kind, whether express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, non-infringement, or accuracy. To the fullest extent permitted by applicable law, we expressly exclude and disclaim all implied warranties, conditions, and other terms that might otherwise be implied.

We disclaim all liability for any loss or damage, whether direct, indirect, incidental, consequential, or otherwise, arising from any reliance placed on the Content or from your use of it, to the fullest extent permitted by applicable law. By continuing to access or use the Content, you acknowledge and agree to these terms.