Our powerful JS Calendar component


Post by Nagesh@Apoorva.com »

How can we assign Colors to Users in the Calendar?

We are using the Bryntum Calendar

Attachments
Colors-Users.jpg
Colors-Users.jpg (42.6 KiB) Viewed 649 times

Post by marcio »

Hello Nagesh,

You can set the color using eventColor property https://www.bryntum.com/docs/calendar/api/Scheduler/model/mixin/ResourceModelMixin#field-eventColor

As an example of data, you have:

"resources"  : {
        "rows" : [
            {
                "id"         : "bryntum",
                "name"       : "Bryntum team",
                "eventColor" : "blue"
            },
            {
                "id"         : "hotel",
                "name"       : "Hotel Park",
                "eventColor" : "orange"
            },
            {
                "id"         : "michael",
                "name"       : "Michael Johnson",
                "eventColor" : "deep-orange"
            }
        ]
    }

Best regards,
Márcio


Post by Nagesh@Apoorva.com »

We have about 300 Users or so. So how can we add colors to them dynamically?


Post by mats »

You can set eventColor on a resource anytime:

resource.eventColor = 'blue'

Post by Nagesh@Apoorva.com »

Do you have any set of colors to be used? If so, please provide the list of colors that can be used.
If not can we use the RGB Color Codes or Color Palette for users to pick?


Post by marcio »

Hey, you can use any RGB value there, using the same example that I shared earlier

"resources"  : {
        "rows" : [
            {
                "id"         : "bryntum",
                "name"       : "Bryntum team",
                "eventColor" : "#FA8072"
            },
            {
                "id"         : "hotel",
                "name"       : "Hotel Park",
                "eventColor" : "#FF0000"
            },
            {
                "id"         : "michael",
                "name"       : "Michael Johnson",
                "eventColor" : "#FF4500"
            }
        ]
    }
Attachments
Screenshot 2022-11-04 at 14.41.48.png
Screenshot 2022-11-04 at 14.41.48.png (455.16 KiB) Viewed 622 times

Best regards,
Márcio


Post by Nagesh@Apoorva.com »

Hi, we could add colors to users and their respective events. But when the calendar view change to month or Agenda the result view is not expected you can see that in the attachments.
We observed that a similar issue was fixed in version 4.3.7 but we are using version 4.3.9. Are there any code changes to be done from our end?

Attachments
Screenshot 2023-04-21 124122.png
Screenshot 2023-04-21 124122.png (115.91 KiB) Viewed 438 times
Screenshot 2023-04-21 123935.png
Screenshot 2023-04-21 123935.png (174.71 KiB) Viewed 438 times

Post by Animal »

Non all-day events are not rendered with a solid bar if you look at views which show an event bar

You can change this in a renderer:

Screenshot 2023-04-21 at 09.21.29.png
Screenshot 2023-04-21 at 09.21.29.png (207.38 KiB) Viewed 437 times

Post by Nagesh@Apoorva.com »

We are referring to events with colored bullet points in a month and an agenda view for non-all-day events.
Thanks

Attachments
2023-04-21_14-37-33.png
2023-04-21_14-37-33.png (119.94 KiB) Viewed 430 times

Post by Animal »

I would advise you to upgrade to the latest version. 4.3.9 is over fourteen months old. There have been many bugs fixed since then.


Post Reply