In order to provide a sample code, please clarify the following. If the task has two colors, one for the planned time and one for the risk time, will the percent complete be restrained only to the planned time part of the task? Also are you planning to use the feature for percent complete adjustment at all? If you are not planning to allow the user to update the percent complete, then the amount of planned time versus the total time could be set to the percent complete field and the drag handle used for percent complete adjustment could be removed.
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI