IgniteUI / igniteui-angular

Ignite UI for Angular is a complete library of Angular-native, Material-based Angular UI components with the fastest grids and charts, Pivot Grid, Dock Manager, Hierarchical Grid, and more.
https://www.infragistics.com/products/ignite-ui-angular
Other
571 stars 161 forks source link

Default Chart label styles are overriden by typography styles from library #11707

Closed hanastasov closed 2 years ago

hanastasov commented 2 years ago

Styles from typography break the chart label styles:

image

See how label are bigger than expected and top edge of chart is cut off.

hanastasov commented 2 years ago

It is very strange, when we stry setting this in chart template:

    xAxisLabelTextStyle="normal 400 14px inherit, sand-serif"
    yAxisLabelTextStyle="normal 400 14px 'Titillium Web'"

For some reason, the definiton with inherit makes the the chart disrecpect the size, maybe the weight too.

damyanpetev commented 2 years ago

Bonus: seems like the inherit portion makes the font shortcut invalid - pretty easy to check against a paragraph for example: https://stackblitz.com/edit/angular-hqqn9j-16qzvm?file=src%2Fapp%2Fcolumn-chart-multiple-sources%2Fcategory-chart-column-chart-multiple-sources.component.html image image

Which is why the size (and anything else for that matter) is ignored and by Graham's estimation the last used font (likely some title) is used, explaining the extra large axis labels.

Edit: Just noticed the numbers as well as what they stand for, 2.125rem will make the labels kinda huge if it did work

sdimchevski commented 2 years ago

For the Category charts what we have in the UI kits is this:

Material: Titles: Titillium Web (Semibold,) 20px Labels: Titillium Web (Regular), 14px Axis Titles: Titillium Web (Regular), 14px

Indigo: Titles: Nunito Sans (Semibold), 20px Labels: Nunito Sans (Regular), 14px Axis Titles: Nunito Sans (Regular), 14px

Fluent: Titles: Open Sans (Regular), 20px Labels: Open Sans (Regular), 14px Axis Titles: Open Sans (Regular), 14px

Bootstrap: Titles: Roboto (Medium), 16px Labels: Roboto (Regular), 14px Axis Titles: Roboto (Regular), 14px

damyanpetev commented 2 years ago

For the Category charts what we have in the UI kits is this:

Material: Titles: Titillium Web (Semibold,) 20px Labels: Titillium Web (Regular), 14px Axis Titles: Titillium Web (Regular), 14px

Indigo: Titles: Nunito Sans (Semibold), 20px Labels: Nunito Sans (Regular), 14px Axis Titles: Nunito Sans (Regular), 14px

Fluent: Titles: Open Sans (Regular), 20px Labels: Open Sans (Regular), 14px Axis Titles: Open Sans (Regular), 14px

Bootstrap: Titles: Roboto (Medium), 16px Labels: Roboto (Regular), 14px Axis Titles: Roboto (Regular), 14px

As far as I understood it, the chart titles are using the equivalent H6 typography, right? Just clarifying so the H6 styles can be reused in the theme just as they are in the designs, unless they should differ.

SisIvanova commented 2 years ago

It turns out that two of the values in the font shorthand are mandatory:

If either of these is not included, the entire declaration will be ignored. Also, font-family must be declared last of all values, otherwise, again, the entire declaration will be ignored.

https://css-tricks.com/almanac/properties/f/font/

hanastasov commented 2 years ago

A note for myself: after verifying this, check #17608

damyanpetev commented 2 years ago

It turns out that two of the values in the font shorthand are mandatory:

  • font-size
  • font-family

If either of these is not included, the entire declaration will be ignored.

Yup, and inherit is not a valid value for the font-family in the shorthand because it's a global value for everything and can't be distinguished as the family specifically or anything else ;)

simeonoff commented 2 years ago

@SisIvanova We have to add the font-weight property to the generated typography variables.

The value format is font-weight font-size font-family;